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

Errors from remote services not correctly formatted at endpoint level #25

Closed
claustres opened this issue Jun 6, 2019 · 1 comment
Closed
Labels

Comments

@claustres
Copy link
Member

claustres commented Jun 6, 2019

Steps to reproduce

Run an authenticated app with some services.
Run a microservices app exposed to the first one.
Try to reach a remote service from the authenticated app API endpoint without a token, eg open http://localhost:8081/api/remote_service in a browser.

Expected behavior

The 401 HTML error page should be returned

Actual behavior

The browser display [object Object]. This is probably due to the fact the raw error object is returned. The behavior might be similar to what happen in #3: because the express.errorHandler() middleware is registered before the remote services it is not applied on remote errors.

System configuration

Module versions : 0.3.4

NodeJS version: 8.9

Operating System: Windows

@claustres claustres added the bug label Jun 6, 2019
@claustres
Copy link
Member Author

Partially solved by 1dc0714, using the error handler as an after middleware.

However the returned error page is a general error, it does not maintain the original error type property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant