[SEMVER-MAJOR] Implement strong error handler for rest-adapter - #302
Conversation
| }); | ||
|
|
||
| it('should disable stack trace', function(done) { | ||
| it.skip('should disable stack trace', function(done) { |
There was a problem hiding this comment.
this test is for process.env.NODE_ENV = 'production';
do we still want to support this?
|
@bajtos PTAL |
|
@davidcheung I added two commits improving release notes, PTAL 751e708, 40e3d04. Feel free to squash them into your commit and dropping my authorship along the way. |
| You can learn more about the rationale behind the new handler in | ||
| [this comment](https://github.com/strongloop/loopback/issues/1650#issuecomment-161920555) | ||
|
|
||
| User can specific options in their applications in `config.json` as follow: |
There was a problem hiding this comment.
Are you sure about this? I think a better option is to configure strong-remoting's error handler via server/middleware.json, but we may not be there yet.
{
"routes": {
"loopback#rest": {
"params": {
"debug": true,
"log": true
}
}
}There was a problem hiding this comment.
hmm it works in my sand-box
i think the behavior comes from
strong-remoting/lib/rest-adapter.js
Line 315 in aa391d2
There was a problem hiding this comment.
maybe we can update this when we change it to use middleware.json?
There was a problem hiding this comment.
We are already using middleware.json. But never mind, let's leave this out of scope of this pull request and stay consistent with the current state of affairs (i.e. configure it via server/config.json).
|
@davidcheung reviewed. |
a459390 to
4e1e6a0
Compare
|
@bajtos PTAL again |
| "restApiRoot": "/api", | ||
| "host": "0.0.0.0", | ||
| "port": 3000, | ||
| "errorHandler": { |
There was a problem hiding this comment.
One more question though, I think errorHandler should be nested under remoting, could you please check?
{
"restApiRoot": "/api",
"remoting": {
"errorHandler": {
"debug": true
}
}
}There was a problem hiding this comment.
you're right, the one I have was wrong, fixed.
|
Looks mostly good, I left two more comments to address. |
4e1e6a0 to
41bf6f7
Compare
|
Thanks @bajtos! I have addressed your comments PTAL |
| } | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Please add a link to strong-error-handler GH repository, so that people can easily find description of the config options available.
There was a problem hiding this comment.
Ah, I see the link is already included below, ignore this comment.
|
One nitpick, the rest LGTM. No further review is necessary. @davidcheung this depends on loopbackio/strong-error-handler#11, doesn't it? Please wait with landing this patch until that required PR is landed first and CI builds are green on our Jenkins. (The jobs on Travis will keep failing because strong-error-handler is not published to npmjs.org yet.) |
|
yes what should i do with the
|
Ah, I overlooked that line, please reset it to |
41bf6f7 to
27ba7b3
Compare
|
Please do not merge this yet, my loopback-core module is failing locally but the ci passed |
|
@slnode test please |
|
should land with strongloop/loopback#2375 when ready |
|
@davidcheung could you please add a note into release notes that |
a42ca79 to
aa7cb47
Compare
|
Placeholder: https://github.com/strongloop/loopback-datasource-juggler/blob/b039b51610b5ad14b5abdc5bb9e798baa7c70588/lib/dao.js#L1199 |
|
LGTM |
194cb82 to
5d0dcd2
Compare
|
@davidcheung Did this patch pass CI? Does this patch require loopback-PR#2375? The reason I'm asking is my PR in loopback#2316 was passing, but it fails with lots of failures now with this commit in Thanks! |
|
@Amir-61 both PRs depend on each other to pass, I'm currently waiting for CI to run for loopback-PR#2375, once i merge that both sides should pass |
Using new strong-error-handler for rest-adapter
connect to https://github.com/strongloop-internal/scrum-loopback/issues/852