2
votes
How to catch "System.UnexpectedException: Unable to fetch the OAuth token."
Why don't you use Nebula Logger which supports recording of most Apex logs including Queueable jobs.
Basically you just install the unlocked package to your sandbox.
Then call the Logger method as in ...
1
vote
How to catch "System.UnexpectedException: Unable to fetch the OAuth token."
I've struggled with this exception - it happened when named credential becomes invalid.
You can't cach an unexpected exception. The execution thread will abort immediately.
However it's possible to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
callout × 1320apex × 814
rest-api × 143
unit-test × 127
trigger × 111
future × 104
integration × 103
httprequest × 95
batch × 94
webservices × 91
json × 66
namedcredentials × 63
api × 61
httpcalloutmock × 56
apexrest × 55
rest × 54
soap × 48
visualforce × 39
scheduled-apex × 38
http × 37
exception × 36
asynchronous × 32
lightning-web-components × 31
visual-workflow × 30
oauth2 × 28