Closed Fenny closed 5 years ago
@Fenny Sometimes you want to react on some errors based on their type. For example, the DB returned some validation error and you want to handle it differently than there was no result matching your request. Errors are powerful tool in software development and we should not ignore it altogether because it may put our software in a broken state without us knowing about it :)
Do we need the reject callback inside a promise? The below code seems to be working out for me, it catches any error and instead of rejecting it returns null in the resolve function. Is this bad code, if so why?