Support Topics Documentation Slack YouTube Blog

Creating an error table in the database

I am trying to create a DB table that contains all the errors my app is causing.

The table contains 4 properties: message, time, method, code.

On every Codeless method, I use a try/catch block, and have
a save object block in the catch segment.

However, the error variable does not appear in the database as it should. Furthermore, I do not know how to capture the error code. Is there a better way to do this?

Hi @Andreas_Marinopoulos ,

The error variable contains an object. The object has the following properties: code and message. You can retrieve these properties using the Get Property block:
image

Regards,
Mark

2 Likes

Got it!
@mark-piller also want to get the input into the errors table, to investigate.

I have created a JSON column in the table called “data” and I am doing this:

But the column is coming up empty. Is there something I am missing?

I created a table with JSON column:

Here’s my codeless method for an API service:

Here’s the logic of the method:

Method invocation:

and finally the result:

Thanks @mark-piller I will continue investigating why mine comes back empty and will report back.

The message is coming in perfectly but the code is not. Is the code an integrer or string, maybe my DB schema is wrong?

The code property is a number. Here’s a simple way to check when in doubt - open the Network tab in the browser and see what the server returns:

1 Like

thanks