1234567891011121314151617181920212223242526272829
  1. /*!
  2. * Copyright (c) 2015-2016, Okta, Inc. and/or its affiliates. All rights reserved.
  3. * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
  4. *
  5. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
  6. * Unless required by applicable law or agreed to in writing, software
  7. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  8. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. *
  10. * See the License for the specific language governing permissions and limitations under the License.
  11. */
  12. function AuthApiError(err, xhr) {
  13. this.name = 'AuthApiError';
  14. this.message = err.errorSummary;
  15. this.errorSummary = err.errorSummary;
  16. this.errorCode = err.errorCode;
  17. this.errorLink = err.errorLink;
  18. this.errorId = err.errorId;
  19. this.errorCauses = err.errorCauses;
  20. if (xhr) {
  21. this.xhr = xhr;
  22. }
  23. }
  24. AuthApiError.prototype = new Error();
  25. module.exports = AuthApiError;