Skip to content

Conversation

@brianparry
Copy link
Contributor

Depends on RackHD/on-core#112

@brianparry brianparry force-pushed the views-error-handling branch 3 times, most recently from 7d4079c to 8dec87e Compare April 13, 2016 20:41
})
.catch(function(err) {
throw new Errors.ViewRenderError(err.message);
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@brianparry brianparry changed the title Cleanup error handling in Swagger renderer Clean up error handling in Swagger renderer Apr 13, 2016
@brianparry brianparry force-pushed the views-error-handling branch from 8dec87e to e7af139 Compare April 13, 2016 20:43
// Remove whitespace
return data.replace(/\s/g, '');
})
.catch(function(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this catch is not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, you're right. The reason I added it is to convert an AssertionError to a ViewRenderError so that the status property is set properly for the swagger render fitting. Since both AssertionError and ViewRenderError result in 500 status, it ultimately doesn't matter but there could be problems if other unexpected errors are thrown or if we decide that we want to change the status code for ViewRenderError.

@yyscamper
Copy link
Contributor

Still 👍 with some minor suggestion.

@brianparry
Copy link
Contributor Author

RackHD/on-core#112 is merged, so test this please

@dalebremner
Copy link
Contributor

+1

@brianparry brianparry merged commit 5395a4f into RackHD:master Apr 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants