https://linen.dev logo
#help
Title
a

alok yadav

07/17/2023, 11:19 AM
Hi Team, How can i mock api in wiremock so that it throw resource access exception?
o

Oleg Nenashev

07/17/2023, 11:54 AM
Hmm. Do you expect
resource access exception
to be return in response? You can definitely do that, but exception propagation to HTTP response depends on a Web framework you use. Ultimately, you need to set the response code, headers and the body to follow the response specification of your API provider
a

alok yadav

07/17/2023, 12:27 PM
What response code and header shall i set so that on calling this api, i should get an error as resource access exception. i.e unable to access resource
o

Oleg Nenashev

07/17/2023, 12:32 PM
It depends on your Server API specification and client implementation. There is no standard for sending exceptions over HTTP
a

alok yadav

07/29/2023, 4:22 PM
Thanks @Oleg Nenashev