alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
update app error and use case error
author
Wesley Finck
date
9 months ago
(Oct 3, 2025, 11:13 AM -0700)
commit
f4686b62
f4686b6241654630a1c8d9151c56faf1262a5de0
parent
a6f57ec1
a6f57ec1eaee8da88d686c285ff9cd9b6a3256dc
+8
-4
2 changed files
Expand all
Collapse all
Unified
Split
src
shared
core
AppError.ts
UseCaseError.ts
+3
-3
src/shared/core/AppError.ts
View file
Reviewed
···
2
2
import { UseCaseError } from './UseCaseError';
3
3
4
4
export namespace AppError {
5
5
-
export class UnexpectedError extends Err<any, UseCaseError> {
5
5
+
export class UnexpectedError extends UseCaseError {
6
6
message: string;
7
7
public constructor(err: any) {
8
8
-
super(Error(`An unexpected error occurred.`));
8
8
+
super(`An unexpected error occurred.`);
9
9
console.log(`[AppError]: An unexpected error occurred`);
10
10
console.error(err);
11
11
-
this.message = JSON.stringify(err);
11
11
+
this.message = err.toString ? err.toString() : JSON.stringify(err);
12
12
}
13
13
14
14
public static create(err: any): UnexpectedError {
+5
-1
src/shared/core/UseCaseError.ts
View file
Reviewed
···
1
1
-
interface IUseCaseError {
1
1
+
interface IUseCaseError extends Error {
2
2
message: string;
3
3
}
4
4
5
5
export abstract class UseCaseError implements IUseCaseError {
6
6
public readonly message: string;
7
7
+
public name: string = 'UseCaseError';
7
8
8
9
constructor(message: string) {
9
10
this.message = message;
11
11
+
}
12
12
+
toString(): string {
13
13
+
return `${this.constructor.name}: ${this.message}`;
10
14
}
11
15
}