Skip to content

Commit 2a0448c

Browse files
committed
refactor: remove createCoreException
1 parent eff6779 commit 2a0448c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/exception.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ class ExceptionBuilder<
7373
private params?: TParams;
7474
private staticMethods = {} as TStaticMethods;
7575

76-
static createCoreException<TName extends ExceptionName>(name: TName): SingleKeyMap<TName, CoreExceptionConstructor> {
77-
const constructor = class extends BaseException<{ name: TName }, ExceptionOptions> {
78-
override name = name;
79-
};
80-
return objectify(name, constructor);
81-
}
82-
8376
build(): [TParams] extends [ExceptionParams]
8477
? SingleKeyMap<TParams['name'], ExceptionType<NonNullable<TParams>, TOptions, TStaticMethods>>
8578
: never;
@@ -140,7 +133,7 @@ class ExceptionBuilder<
140133
}
141134
}
142135

143-
const { ValueException } = ExceptionBuilder.createCoreException('ValueException');
136+
const { ValueException } = new ExceptionBuilder().setParams({ name: 'ValueException' }).build();
144137

145138
const { OutOfRangeException } = new ExceptionBuilder()
146139
.extend(ValueException)

0 commit comments

Comments
 (0)