{"version":3,"file":"ngx-stoui-error-handler.mjs","sources":["../../../../libs/error-handler/src/lib/error-handler/dialog/dialog.component.ts","../../../../libs/error-handler/src/lib/error-handler/dialog/dialog.component.html","../../../../libs/error-handler/src/lib/error-handler/error-dialog.service.ts","../../../../libs/error-handler/src/lib/error-handler/http-error.ts","../../../../libs/error-handler/src/lib/error-handler/token.ts","../../../../libs/error-handler/src/lib/error-handler/error-handler.service.ts","../../../../libs/error-handler/src/lib/error-handler/error-handler.module.ts","../../../../libs/error-handler/src/index.ts","../../../../libs/error-handler/src/ngx-stoui-error-handler.ts"],"sourcesContent":["import { CdkScrollable } from '@angular/cdk/scrolling';\nimport { Component, inject } from '@angular/core';\nimport {\n  MAT_DIALOG_DATA,\n  MatDialogActions,\n  MatDialogClose,\n  MatDialogContent,\n  MatDialogRef,\n  MatDialogTitle,\n} from '@angular/material/dialog';\nimport { HttpError } from '../http-error';\n\nimport { MatButton } from '@angular/material/button';\n\n@Component({\n  selector: 'sto-dialog',\n  templateUrl: './dialog.component.html',\n  styleUrl: './dialog.component.scss',\n  imports: [\n    MatDialogTitle,\n    CdkScrollable,\n    MatDialogContent,\n    MatDialogActions,\n    MatButton,\n    MatDialogClose,\n  ],\n})\nexport class DialogComponent {\n  readonly data = inject<HttpError>(MAT_DIALOG_DATA);\n  private readonly ref = inject(MatDialogRef<DialogComponent>);\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  handleEvent(action: ((...args: any[]) => unknown) | unknown | undefined) {\n    if (typeof action === 'function') {\n      try {\n        action(this.data);\n      } catch (ex) {\n        console.warn('Failed to execute function.');\n        console.warn(ex);\n      }\n    }\n    this.ref.close(action || this.data);\n  }\n}\n","<h3 style=\"font-weight: 500\" mat-dialog-title>\n  {{ data.title }}\n</h3>\n<mat-dialog-content>\n  <p style=\"font-size: 16px; white-space: pre-line\">{{ data.text }}</p>\n</mat-dialog-content>\n<mat-dialog-actions style=\"justify-content: flex-end\">\n  @if (!(data.actions || []).length) {\n    <button color=\"primary\" matButton=\"filled\" mat-dialog-close>OK</button>\n  }\n  @for (a of data.actions; track a) {\n    <button\n      color=\"primary\"\n      matButton=\"filled\"\n      (click)=\"handleEvent(a.action || a.closeDialogData)\"\n    >\n      {{ a.label }}\n    </button>\n  }\n</mat-dialog-actions>\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DialogComponent } from './dialog/dialog.component';\nimport { HttpError } from './http-error';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class ErrorDialogService {\n  private dialog = inject(MatDialog);\n\n  private ref: MatDialogRef<DialogComponent>;\n\n  // Opens a dialog, and returns the reference with the close results.\n  open(err: HttpError): MatDialogRef<DialogComponent, unknown> {\n    if (this.ref) {\n      this.ref.close(null);\n    }\n    this.ref = this.dialog.open(DialogComponent, {\n      data: err,\n      width: '560px',\n      autoFocus: false,\n      disableClose: true,\n      panelClass: 'sto-dialog',\n    });\n    return this.ref;\n  }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\n/**\n * Internal HttpError format\n */\nexport class HttpError {\n  // Status code\n  status: number;\n  // Dialog title\n  title: string;\n  // Dialog body\n  text: string;\n  // Action list.\n  actions: Action[] = [];\n\n  constructor(public readonly error: HttpErrorResponse) {\n    this.status = error.status;\n  }\n}\n\n/**\n * Available properties on dialog actions\n */\nexport class Action {\n  /**\n   * Button label\n   */\n  label: string;\n  /**\n   * A function to be called based on the given action (e.g window.location.reload to refresh the tab)\n   */\n  action?: (...args: unknown[]) => unknown;\n  /**\n   * The data to be returned when the dialog is closed.\n   */\n  closeDialogData?: Record<string, unknown>;\n\n  constructor(label: string);\n  constructor(label: string, close: () => void);\n  constructor(label: string, close: Record<string, unknown>);\n  constructor(label: string, close?: Record<string, unknown> | (() => unknown)) {\n    this.label = label;\n    if ( typeof close === 'function' ) {\n      // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n      // @ts-ignore\n      this.action = close;\n    } else {\n      this.closeDialogData = close;\n    }\n  }\n}\n","import { InjectionToken } from '@angular/core';\nimport { ErrorHandler, ErrorLogger } from './error-handler';\n\n// Custom error handler injection token, used to override error handlers\nexport const CUSTOM_ERROR_HANDLER = new InjectionToken<ErrorHandler>('sto.custom-error-handler');\n// Error logger injection token, to enable error logging.\nexport const ERROR_LOGGER = new InjectionToken<ErrorLogger>('sto.error-logger');\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { ErrorDialogService } from './error-dialog.service';\nimport { ErrorHandler, ErrorLogger, Handler } from './error-handler';\nimport { Action, HttpError } from './http-error';\nimport { CUSTOM_ERROR_HANDLER, ERROR_LOGGER } from './token';\n\n@Injectable({\n  providedIn: 'root',\n})\n/**\n * Service used to handle errors across our applications. Replaces the previous HttpErrorHandler\n */\nexport class ErrorHandlerService implements ErrorHandler {\n  private errorDialogService = inject(ErrorDialogService);\n  private customHandler = inject<ErrorHandler>(CUSTOM_ERROR_HANDLER, {\n    optional: true,\n  });\n  private logger = inject<ErrorLogger>(ERROR_LOGGER, { optional: true });\n\n  /**\n   * Satisfies Angular global ErrorHandler interface\n   * @param err\n   */\n  handleError(err: any): void {\n    if (err instanceof HttpErrorResponse) {\n      this.handler(err);\n    } else {\n      // Non HTTP errors are re-thrown.\n      throw err;\n    }\n  }\n\n  /**\n   * Global handler. This method will try (in order): passed in handler -> custom handler -> default handler for code -> defaultHandler\n   * All errors are passed to a dialog to be displayed there, and will by default have a simple \"OK\" button to close.\n   * @param err\n   * @param handler\n   */\n  handler(err: HttpErrorResponse, handler?: Handler) {\n    let fn: Handler | undefined;\n    let actions: Action[] = [];\n    fn = handler;\n    if (!fn && this.customHandler) {\n      fn = this.customHandler[err.status] || this.customHandler.defaultHandler;\n    }\n    if (!fn) {\n      fn = this[err.status] || (this.defaultHandler as Handler);\n      actions = [{ label: 'OK' }];\n    }\n    // Ensure we bind the function to the correct context.\n    const error = fn.bind(this)(err);\n    // Add a default \"OK\" action, but only if the global handlers are used.\n    // OK is also shown if no actions are passed in.\n    error.actions = [...actions, ...error.actions];\n    if (this.logger) {\n      // Apply logger if available.\n      this.logger.log(error);\n    }\n    this.errorDialogService.open(error);\n  }\n\n  // Fallback handler if unknown code\n  defaultHandler(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = `Application error`;\n    const errorText = this.getErrorText(err);\n    error.text = `The application experienced an unknown or unexpected exception. The exception is listed below:\n    ${errorText}`;\n    error.actions = [new Action('Refresh', () => window.location.reload())];\n    return error;\n  }\n\n  // Signature for error handlers\n  [code: number]: Handler;\n\n  0(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = 'No connection';\n    const offline = !window.navigator.onLine;\n    if (offline) {\n      error.text = `You are not connected to the internet.`;\n    } else {\n      error.text = `We were unable to establish a connection to the server. There can be several reasons for this:\n\n    - There was an intermittent connection loss\n    - The request timed out`;\n    }\n    return error;\n  }\n\n  400(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = 'Errors in submitted form';\n    const errorText = this.getErrorText(err);\n    error.text = `The form contained invalid data.\n\n    ${errorText}`;\n    return error;\n  }\n\n  401(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = `Not signed in`;\n    error.text = `You are not signed in or your session has expired. Please sign in and try again.`;\n    error.actions = [];\n    return error;\n  }\n\n  403(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = `Not authorized.`;\n    error.text = `You do not have access to perform this action.\n    Apply for the correct roles in Access IT.`;\n    error.actions = [\n      {\n        label: 'ACCESS IT',\n        action: () => window.open('https://accessit.equinor.com/', '_blank'),\n      },\n    ];\n    return error;\n  }\n\n  404(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = 'Item not found';\n    const errorText = this.getErrorText(err);\n    error.text = `The requested item / resource was not found.\n\n    ${errorText}\n    `;\n    return error;\n  }\n\n  409(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = 'This resource has changed';\n    const errorText = this.getErrorText(err);\n    error.text = `This resource/item has been updated on the server. Please reload and try again.\n\n    ${errorText}`;\n    error.actions = [\n      { label: 'Reload', action: () => window.location.reload() },\n    ];\n    return error;\n  }\n\n  500(err: HttpErrorResponse) {\n    const error = new HttpError(err);\n    error.title = `Unexpected error occurred`;\n    const errorText = this.getErrorText(err);\n    error.text = `We experienced an unknown exception. Please report this via Services @ Equinor\n\n    ${errorText}`;\n    error.actions = [\n      {\n        label: 'Services @ Equinor',\n        action: () => window.open(`https://equinor.service-now.com`, '_blank'),\n      },\n    ];\n    return error;\n  }\n\n  501(err: HttpErrorResponse) {\n    return this[500](err);\n  }\n\n  503(err: HttpErrorResponse) {\n    return this[500](err);\n  }\n\n  /**\n   * Uses the getErrorText from the provided custom handler, if available.\n   * Otherwise, return the error message, if available in our desired format\n   * Expected err.error -> { message | detail: 'A message', ... }\n   * Also handles text as a fallback.\n   * */\n  getErrorText(err: HttpErrorResponse) {\n    if (this.customHandler && this.customHandler.getErrorText) {\n      return this.customHandler.getErrorText(err);\n    }\n    let errorText: string;\n    try {\n      const e = err.error instanceof Object ? err.error : JSON.parse(err.error);\n      errorText = e.message || e.detail;\n    } catch (ex) {\n      errorText = typeof err.error === 'string' ? err.error : '';\n    }\n    return errorText;\n  }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { DialogComponent } from './dialog/dialog.component';\nimport { ErrorDialogService } from './error-dialog.service';\nimport { ErrorHandlerService } from './error-handler.service';\n\n@NgModule({\n    imports: [CommonModule, MatDialogModule, MatButtonModule, DialogComponent],\n    providers: [ErrorHandlerService, ErrorDialogService],\n})\nexport class ErrorHandlerModule {}\n","/*\n * Public API Surface of stoui-error-handler\n */\n\nexport * from './lib/error-handler/error-dialog.service';\nexport * from './lib/error-handler/error-handler';\nexport * from './lib/error-handler/error-handler.service';\nexport * from './lib/error-handler/error-handler.module';\nexport * from './lib/error-handler/http-error';\nexport * from './l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