UNPKG

@actinc/dls

Version:

Design Language System (DLS) for ACT & Encoura front-end projects.

21 lines 699 B
/** * Copyright (c) ACT, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import get from 'lodash/get'; export var getErrorMessage = function (err) { var errorMessage = ''; var graphQlErrorMessage = get(err, 'networkError.result.errors[0].message'); var standardErrorMessage = get(err, 'message'); if (graphQlErrorMessage) { errorMessage = graphQlErrorMessage; } else if (standardErrorMessage) { errorMessage = standardErrorMessage; } return errorMessage.trim(); }; export default getErrorMessage; //# sourceMappingURL=getErrorMessage.js.map