restify / restify/errors

trying to set extra options in error to send to response.

Open
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
144
Forks
30
Avg merge
2d 2h
Merged PRs (30d)
6

Description

I want to set extra options in error response. Didn't find the exact solution anywhere.

tried passing in the body

const errors = require('restify-errors');
new errors.MethodNotAllowedError({ body: { extra: option } }, some-error-message));

what's the exact method to allow some extra options in error response?

Is there a way to set the default for all the errors and just pass the extra field parameters?

Also, I just want options in already existing error methods.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing MethodNotAllowedError and other error methods in restify-errors to determine how response options are currently passed. Define whether per-error extra fields and defaults for all errors are both required; done should include documented behavior and coverage for the requested response options.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.