Skip to content
#

errors

Here are 330 public repositories matching this topic...

venkatvghub
venkatvghub commented Aug 23, 2019

I am trying to use your package for certain use cases and i am confused beyond a point. For instance, i have scenarios for custom errors and error types or error codes etc. I am looking at adding namespaces etc and your documentation is not helping me move forward. Could someone please address it and help me or developers like me understand how to go about using your library better?

morningvera
morningvera commented Feb 18, 2020

For completion, we should offer an As method like the one in Go 1.13 errors (https://golang.org/pkg/errors/#As). We should try to make this more reliable than Go's version by preventing panics: "As will panic if target is not a non-nil pointer to either a type that implements error, or to any interface type." Seems like we could just return false in these cases instead.

danieljoppi-avalara
danieljoppi-avalara commented Sep 5, 2017

Add a previous Error on throw.js engine.

errors.BadRequest(err, 'Error on MongoDB');

example:

const errors = require('throw.js');
const mongoose = require('mongoose');
const User = mongoose.model('user');

app.get('/', (req, res, next) => Promise.resolve().then(() => {
  let {query} = req;
  if (!query.id) {
    throw errors.BadRequest('Missing 
ngan
ngan commented Apr 7, 2020

Description

config.ignore_classes should take an array of strings instead of constants (or either?)

Issue

As we add error classes to the ignore_classes we're realizing that we're inadvertently loading those classes that don't need to be loaded. It would be good if ignore_classes can take in an array of class names as strings since this comparison is done at the time of error any

ValentinGB
ValentinGB commented Feb 7, 2019

I have the following schema

const   mongoose        = require('mongoose'),
        uniqueValidator  = require('mongoose-beautiful-unique-validation'),
        Schema          = mongoose.Schema;

const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

const ClientSchema = new

Improve this page

Add a description, image, and links to the errors topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the errors topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.