Recent searches
No recent searches
Is it possible to log errors happening in custom application?
Posted Mar 17, 2022
I have custom application on the ticket page. It makes call on external api and shows some information. But i want to log errors that happen during that call. Is there any instruments in zendesk for doing this?
0
5
5 comments
Tipene Hughes
Hi Vladyslav Filonov,
Thanks for reaching out!
When making calls to external APIs with the client.request method, a response object is returned which contains properties you can access to display certain information. For example, you could console.log(response.responseText) to log any errors resulting from a failed API call. Here's a link to the documentation that goes in to a bit more detail:
I hope this helps! Let me know if you have any questions.
Tipene
0
Vladyslav Filonov
I believe that console.log is not the best idea to log errors. Is there any other way to do that?
0
Tipene Hughes
Hi Vladyslav Filonov,
You can manipulate the data returned in the response object in whichever way you need - it doesn't need to be a console log. If you want to let me know what your use case, I'll be happy to point you in the right direction.
Tipene
0
Vladyslav Filonov
I dont want agents see errors in app window or console. But me as admin want to have oportunity to see logs with details (e.g. in Admin Center) in case of errors. Is there any opportunity for doing that?
0
Tipene Hughes
Then, you could use something like Node.js to write an error handler that adds the errors to a .txt file.
0