File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
components/server/ee/src/user Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import {
14
14
stripeClientRequestsCompletedDurationSeconds ,
15
15
} from "../../../src/prometheus-metrics" ;
16
16
import { BillingServiceClient , BillingServiceDefinition } from "@gitpod/usage-api/lib/usage/v1/billing.pb" ;
17
+ import { ResponseError } from "vscode-ws-jsonrpc" ;
18
+ import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
17
19
18
20
@injectable ( )
19
21
export class StripeService {
@@ -57,7 +59,10 @@ export class StripeService {
57
59
async getPortalUrlForAttributionId ( attributionId : string , returnUrl : string ) : Promise < string > {
58
60
const customerId = await this . findCustomerByAttributionId ( attributionId ) ;
59
61
if ( ! customerId ) {
60
- throw new Error ( `No Stripe Customer ID found for '${ attributionId } '` ) ;
62
+ throw new ResponseError (
63
+ ErrorCodes . NOT_FOUND ,
64
+ `No Stripe Customer ID for attribution ID '${ attributionId } '` ,
65
+ ) ;
61
66
}
62
67
const session = await reportStripeOutcome ( "portal_create_session" , ( ) => {
63
68
return this . getStripe ( ) . billingPortal . sessions . create ( {
You can’t perform that action at this time.
0 commit comments