{ "version": 3, "sources": ["libs/util-errors/src/lib/transaction.ts", "apps/dashboard/src/app/error/error.component.ts", "apps/dashboard/src/app/error/error.component.html"], "sourcesContent": ["// Generate a unique transaction ID for errors\nconst transactionId = Math.random().toString(36).substr(2, 9);\n\nexport function getTransactionId(): string {\n return transactionId;\n}\n", "import { CommonModule } from '@angular/common';\nimport { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, RouterModule } from '@angular/router';\nimport { ErrorService, getTransactionId } from '@sites/util-errors';\n\nexport enum ErrorType {\n UNKNOWN = 'unknown',\n NOT_FOUND = 'not-found',\n UNAUTHORIZED = 'unauthorized',\n PERMISSION_DENIED = 'permission-denied',\n}\n\n@Component({\n selector: 'dashboard-error',\n templateUrl: './error.component.html',\n standalone: true,\n imports: [CommonModule, RouterModule],\n})\nexport class ErrorComponent implements OnInit {\n errorType: ErrorType = ErrorType.UNKNOWN;\n types = ErrorType;\n id = getTransactionId();\n timestamp = new Date().toUTCString();\n errorMessage = '';\n mailTo = '';\n\n constructor(\n private route: ActivatedRoute,\n private errorService: ErrorService\n ) {\n this.route.url.subscribe((url) => {\n const path = url[0]?.path || 'error';\n this.errorType = this.parsePath(path);\n });\n }\n\n ngOnInit() {\n this.errorMessage = this.errorService.getLastMessage();\n this.mailTo = this.generateMailTo();\n }\n\n private parsePath(path: string): ErrorType {\n switch (path) {\n case 'error':\n return ErrorType.UNKNOWN;\n case 'denied':\n return ErrorType.PERMISSION_DENIED;\n case 'unauthorized':\n return ErrorType.UNAUTHORIZED;\n default:\n return ErrorType.NOT_FOUND;\n }\n }\n\n private generateMailTo(): string {\n const email = 'support@humanmademachine.com';\n const subject = `Help with ${this.errorType} ${this.id} on ${this.timestamp}`;\n\n return `mailto:${email}?subject=${subject}`;\n }\n}\n", "
You've hit an error which wasn't handled.
\n\n Email support@humanmademachine.com\n with code\n {{ id }}\n who will be able to help with the issue.\n
\nThere is nothing on this page.
\n\n Email support@humanmademachine.com\n with code\n {{ id }}\n who might be able to find what you were looking for.\n
\nYou don't have access to this.
\n\n Email support@humanmademachine.com\n with code\n {{ id }}\n who might be able to give you permission to see it.\n
\nWe were unable to log you in.
\n\n Email support@humanmademachine.com\n with code\n {{ id }}\n who will be able to help get you access.\n
\n