UNPKG

@atrysglobal/babel-ripper

Version:

Interface and strict typing toolkit for accessing the BABEL unified translation service.

17 lines (16 loc) 756 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BabelHandler = void 0; class BabelHandler { static fromAxios(exception) { if (exception.response) { throw new Error(`Exception received from remote BABEL API - (status code ${exception.response.status} ${exception.response.statusText}) - ${JSON.stringify(exception.response.data)} `); } else if (exception.request) { // The request was made but no response was received throw new Error(`Connection couldn't be stablished with remote BABEL API. ` + `Please check your internet connection, proxy configuration or BABEL service status `); } } } exports.BabelHandler = BabelHandler;