CGUC / skybunk-server

The back-end application for Conrad Grebel University College students to stay connected
3 stars 9 forks source link

Change login error format to match that of client #92

Closed picklechips closed 5 years ago

picklechips commented 5 years ago

This refers to the errors such as "Username not found" or "Incorrect password" when attempting to log in

The linting commit changed the way this error was formatted so it wasn't compatible with the client. This changes it back, however we should probably standardise the format of our error handling since it's kind of a mess as is.

aopal commented 5 years ago

@picklechips What made the linter's code incompatible with the client? Will we have to manually change this when we run the linter again in the future? If so, could we change something on the client side instead?

picklechips commented 5 years ago

Will we have to manually change this when we run the linter again in the future?

No, it was just because the linter wanted promises to reject an Error object as opposed to a custom object. It was really this line that broke things: https://github.com/CGUC/skybunk-server/commit/31bf3f35817b6d64fb36657109aad694bfc2aa42#diff-d3dcb49f31e1454dea0244e2f90376edL116

We were rejecting a custom object, but the linter wanted an Error object so i was changed. This moves the custom object to the controller, which I think is a cleaner solution anyhow