File tree 1 file changed +9
-5
lines changed
packages/app-store/paypal/lib
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { v4 as uuidv4 } from "uuid";
3
3
import z from "zod" ;
4
4
5
5
import { IS_PRODUCTION , WEBAPP_URL } from "@calcom/lib/constants" ;
6
+ import logger from "@calcom/lib/logger" ;
6
7
import prisma from "@calcom/prisma" ;
7
8
8
9
class Paypal {
@@ -197,12 +198,15 @@ class Paypal {
197
198
body : JSON . stringify ( body ) ,
198
199
} ) ;
199
200
200
- if ( response . ok ) {
201
- const result = await response . json ( ) ;
202
- return result . id as string ;
201
+ if ( ! response . ok ) {
202
+ const message = ` ${ response . statusText } : ${ JSON . stringify ( await response . json ( ) ) } ` ;
203
+ throw new Error ( message ) ;
203
204
}
204
- } catch ( error ) {
205
- console . error ( error ) ;
205
+
206
+ const result = await response . json ( ) ;
207
+ return result . id as string ;
208
+ } catch ( e ) {
209
+ logger . error ( "Error creating webhook" , e ) ;
206
210
}
207
211
208
212
return false ;
You can’t perform that action at this time.
0 commit comments