File tree Expand file tree Collapse file tree 2 files changed +4
-21
lines changed
tests/unit/appsync-graphql Expand file tree Collapse file tree 2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ class AppSyncGraphQLResolver extends Router {
398398 #formatErrorResponse( error : unknown ) {
399399 if ( error instanceof Error ) {
400400 return {
401- error : `${ error . name } - ${ error . message } ` ,
401+ error : `${ error . constructor . name } - ${ error . message } ` ,
402402 } ;
403403 }
404404 return {
Original file line number Diff line number Diff line change @@ -10,26 +10,9 @@ import {
1010import type { ErrorClass } from '../../../src/types/appsync-graphql.js' ;
1111import { onGraphqlEventFactory } from '../../helpers/factories.js' ;
1212
13- class ValidationError extends Error {
14- constructor ( message : string ) {
15- super ( message ) ;
16- this . name = 'ValidationError' ;
17- }
18- }
19-
20- class NotFoundError extends Error {
21- constructor ( message : string ) {
22- super ( message ) ;
23- this . name = 'NotFoundError' ;
24- }
25- }
26-
27- class DatabaseError extends Error {
28- constructor ( message : string ) {
29- super ( message ) ;
30- this . name = 'DatabaseError' ;
31- }
32- }
13+ class ValidationError extends Error { }
14+ class NotFoundError extends Error { }
15+ class DatabaseError extends Error { }
3316
3417describe ( 'Class: AppSyncGraphQLResolver' , ( ) => {
3518 beforeEach ( ( ) => {
You can’t perform that action at this time.
0 commit comments