UNPKG

@aws-amplify/auth

Version:
21 lines (19 loc) 722 B
'use strict'; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.assertServiceError = assertServiceError; const utils_1 = require("@aws-amplify/core/internals/utils"); const AuthError_1 = require("../AuthError"); function assertServiceError(error) { if (!error || error.name === 'Error' || error instanceof TypeError) { throw new AuthError_1.AuthError({ name: utils_1.AmplifyErrorCode.Unknown, message: 'An unknown error has occurred.', underlyingError: error, }); } } //# sourceMappingURL=assertServiceError.js.map