I’ve written a plugin that outputs a list of links for a specified URL.
This question is about error handling.
When I enter a URL that generates a 404 error, I get a very verbose error message.
I know from experimentation that axios (the node module I’m using to get the URL) generates only a tiny bit of it.
So the rest must be generated by Bubble.
My question is, is there anyway to suppress the verbosity and ONLY capture the value of error.message when axios.get(url) throws an error?
Specifically, in the verbose message below:
Plugin action getLinks error:
AxiosError: Request failed with status code 404
at settle (/var/task/node_modules/axios/dist/node/axios.cjs:1859:12)
at Unzip.handleStreamEnd (/var/task/node_modules/axios/dist/node/axios.cjs:2723:11)
at Unzip.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1333:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Error: Outer Error (see above for inner error)
at Block.wait (/var/task/u.js:467:22)
at Object.async_fn [as async] (/var/task/index.js:474:29)
at eval (eval at build_function (/var/task/index.js:53:12), :33:34)
at /var/task/index.js:527:17
at run_fn (/var/task/u.js:645:18)
The part returned in error.message is “Request failed with status code 404”.
That’s the only bit I want to be displayed in the error popup shown to the user.
Does anyone know if this can be done? And if so, how?