Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove req.codes + unused dependencies #359

Merged
merged 5 commits into from
Apr 28, 2016

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Apr 27, 2016

This PR cleans up the server by removing the req.codes file from the repository and unifying error handling in a single function that returns objects with three consumable properties:

  1. code
  2. description
  3. stack

Database errors are handled automatically, returned as BadRequest errors. Any more specificity should be handled via custom interceptors instead of simply calling next().

Additionally, the client-side error handles are now configured in the same place. This is achieved by collapsing the two $http configuration functions into a single function during the application startup process. Eventually AuthInjector should probably be deprecated and removed.

Finally, removes unused dependencies fast-csv and connect-multiparty.

Additionally, this PR includes a really handy improvement to the test shell scripts, ensuring they only kill processes they create, rather than all node process in general. This is a good step in helping to speed up our testing and ensuring no conflicts occur with concurrent builds/installations.

Closes #75 and #287.


Thank you for contributing!

Before submitting this pull request, please verify that you have:

  • Run your code through JSHint. Check out our styleguide.
  • Run integration tests.
  • Run end-to-end tests.
  • Accurately described the changes your are making in this pull request.

For a more detailed checklist, see the official review checklist that this PR will be evaluated against.

Ensuring that the above checkboxes are completed will help speed the review process
and help build a stronger application. Thanks!

jniles added 3 commits April 27, 2016 13:23
This commit removes the dependency on `connect-multiparty` as requested
in #75.

Closes #75.
This commit completely removes `req.codes`.  All errors are handled in a
single error handler that returns errors with three consumable properties:
 1. code
 2. description
 3. stack

Database errors are handled automatically, returned as `BadRequest`
errors.  Any more specificity should be handled via custom interceptors
instead of simply calling `next()`.

Closes #287.
This commit collapses the two $http configuration functions into a
single function during the application startup process.  Eventually
AuthInjector should probably be deprecated and removed.
jniles added 2 commits April 27, 2016 14:44
This commit removes budget routes from the routes.js file and removes
the budget controller until a proper server design is submitted for the
budget controller.
This commit is a critical fix to make sure the test scripts only kill
the process they started, rather than all node processes globally.  This
had the side effect of killing any other node instances, including `npm`
downloads and `node-gyp` builds.  It has been fixed.
@sfount
Copy link
Contributor

sfount commented Apr 28, 2016

Very useful standardisation! 👍

@sfount sfount merged commit a0ac72e into Third-Culture-Software:master Apr 28, 2016
@jniles jniles deleted the chore-server-cleanup branch April 28, 2016 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants