How to use the funtch.errorHandler function in funtch

To help you get started, we’ve selected a few funtch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ViBiOh / dashboard / src / services / Commons / index.js View on Github external
return new Promise((resolve, reject) =>
    errorHandler(response)
      .then(resolve)
      .catch(err =>
        reject(
          new Error({
            ...err,
            toString: () => {
              if (!err.content && httpErrorMessage[err.status]) {
                return httpErrorMessage[err.status];
              }

              if (typeof err.content === 'string') {
                return err.content;
              }

              return JSON.stringify(err.content);
            },
github ViBiOh / dashboard / app / services / Commons / index.js View on Github external
return new Promise((resolve, reject) =>
    errorHandler(response).then(resolve).catch(err =>
      reject({
        ...err,
        toString: () => {
          if (typeof err.content === 'string') {
            return err.content;
          }
          return JSON.stringify(err.content);
        },
      }),
    ),
  );

funtch

FUNctional feTCH isomorphic

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis