@@ -544,7 +544,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
544
544
res . rows = res . rows . map ( this . censorUser ) ;
545
545
return res ;
546
546
} catch ( e ) {
547
- throw new ResponseError ( 500 , e . toString ( ) ) ;
547
+ throw new ResponseError ( ErrorCodes . INTERNAL_SERVER_ERROR , e . toString ( ) ) ;
548
548
}
549
549
}
550
550
@@ -559,7 +559,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
559
559
try {
560
560
result = await this . userDB . findUserById ( userId ) ;
561
561
} catch ( e ) {
562
- throw new ResponseError ( 500 , e . toString ( ) ) ;
562
+ throw new ResponseError ( ErrorCodes . INTERNAL_SERVER_ERROR , e . toString ( ) ) ;
563
563
}
564
564
565
565
if ( ! result ) {
@@ -606,7 +606,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
606
606
try {
607
607
await this . userDeletionService . deleteUser ( userId ) ;
608
608
} catch ( e ) {
609
- throw new ResponseError ( 500 , e . toString ( ) ) ;
609
+ throw new ResponseError ( ErrorCodes . INTERNAL_SERVER_ERROR , e . toString ( ) ) ;
610
610
}
611
611
}
612
612
@@ -1862,7 +1862,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
1862
1862
return setupIntent . client_secret || undefined ;
1863
1863
} catch ( error ) {
1864
1864
log . error ( "Failed to create Stripe SetupIntent" , error ) ;
1865
- throw new ResponseError ( 500 , "Failed to create Stripe SetupIntent" ) ;
1865
+ throw new ResponseError ( ErrorCodes . INTERNAL_SERVER_ERROR , "Failed to create Stripe SetupIntent" ) ;
1866
1866
}
1867
1867
}
1868
1868
@@ -1875,7 +1875,10 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
1875
1875
return customer ?. id || undefined ;
1876
1876
} catch ( error ) {
1877
1877
log . error ( `Failed to get Stripe Customer ID for team '${ teamId } '` , error ) ;
1878
- throw new ResponseError ( 500 , `Failed to get Stripe Customer ID for team '${ teamId } '` ) ;
1878
+ throw new ResponseError (
1879
+ ErrorCodes . INTERNAL_SERVER_ERROR ,
1880
+ `Failed to get Stripe Customer ID for team '${ teamId } '` ,
1881
+ ) ;
1879
1882
}
1880
1883
}
1881
1884
@@ -1889,7 +1892,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
1889
1892
// TODO(janx): Create a Stripe usage-based Subscription for the customer
1890
1893
} catch ( error ) {
1891
1894
log . error ( `Failed to subscribe team '${ teamId } ' to Stripe` , error ) ;
1892
- throw new ResponseError ( 500 , `Failed to subscribe team '${ teamId } ' to Stripe` ) ;
1895
+ throw new ResponseError ( ErrorCodes . INTERNAL_SERVER_ERROR , `Failed to subscribe team '${ teamId } ' to Stripe` ) ;
1893
1896
}
1894
1897
}
1895
1898
0 commit comments