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

Component Specify Error Response Code #544

Merged
merged 1 commit into from
May 21, 2018
Merged

Conversation

jonwinton
Copy link
Contributor

@jonwinton jonwinton commented May 21, 2018

Allows components to specify a response code when throwing an error. If no status is defined the component will still 500.

  • Status will be logged when specified
  • component instance will be logged in its own property to make it more searchable
module.exports.render = (uri, data, locals) => {
  var foo = new Error('no results for this page!');
  foo.status = 404;
  throw foo;
};

@jonwinton jonwinton changed the title initial work Component Specify Error Response Code May 21, 2018
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1824

  • 26 of 26 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1815: 0.0%
Covered Lines: 4241
Relevant Lines: 4241

💛 - Coveralls

@jonwinton jonwinton merged commit 7e96380 into master May 21, 2018
@jonwinton jonwinton deleted the cmpt-determine-err-resp branch May 21, 2018 17:08
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.

3 participants