#Little_seven

1 messages ยท Page 1 of 1 (latest)

ripe garnetBOT
grim drum
#

Hello there

#

Can you tell me a little bit about why you are worried about catching an invalid key error?

molten terrace
#

I have this platform in which members can setup their own stripe payments using apikeys.

but sometimes due to human error, they may fill-in wrong values.

so need to validate if the keys provided are correct.

as this keys are used in public checkout, and cannot clean display if code breaks when unable to capture error thrown

grim drum
#

I see, thanks for clarifying.

#

Give me a moment to check

molten terrace
#

thank you

grim drum
#

So in the above you don't see the exception error from catching ApiErrorException

molten terrace
#

yes

grim drum
#

Hmm okay

#

Give me a moment to test

molten terrace
#

thank you

grim drum
#

@molten terrace can you try \Stripe\Exception\AuthenticationException?

molten terrace
#

tested, did not work ๐Ÿ˜ฆ

#

I'm using php 8.2 and stripe-9.6.0

valid hawk
molten terrace
#

hello, checking

#

got it,
\Stripe\Exception\AuthenticationException did catch the error given that

where "new \Stripe\StripeClient" is outside try{}catch{} code

valid hawk
#

Okay so wait... does that resolve your issue?

molten terrace
#

yup! thank you.