UNPKG

riotg.api

Version:

<a href="https://www.npmjs.com/package/riotg.api"> <img src="https://img.shields.io/static/v1?label=npm&message=riotg.api&color=red&style=for-the-badge&logo=NPM" /> </a>

14 lines (13 loc) 470 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiError = void 0; const axios_1 = require("axios"); function ApiError(error) { var _a, _b; if (error instanceof axios_1.AxiosError) return { message: (_a = error.response) === null || _a === void 0 ? void 0 : _a.statusText, status: (_b = error.response) === null || _b === void 0 ? void 0 : _b.status, }; } exports.ApiError = ApiError;