PrefectHQ/prefect-ui-library

httpStatus should return false instead of error

dylanbhughes opened this issue · 0 comments

If it throws an error in catch blocks, it stops the execution of further code in that catch block. So let's return false instead to make things like this very easy:

try {} // some try
catch(error) {
  if (httpStatus(error) === 'PAYMENT_REQUIRED') {
    // do thing
  } else {
    // do other thing
  }
}