Skip to content

Validation errors are not consistent for local and remote databases. #4

@tohagan

Description

@tohagan

From my project unit tests I've identified that in order to get identical errors returned from a local or remote database you need the following code change

if (typeof e.unauthorized !== "undefined") {
  throw {
    name: "unauthorized",
    message: 'Name or password is incorrect.',
    reason: e.unauthorized,
    status: 401
  };
} else if (typeof e.forbidden !== "undefined") {
  throw {
    name: "forbidden",
    message: 'Forbidden by design doc validate_doc_update function',
    reason: e.forbidden,
    status: 403
  };
  • renamed message field to reason
  • added new message field text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions