For the complete documentation index, see llms.txt. This page is also available as Markdown.

Error logging and debugging

Logging errors is a crucial part of the error handling mechanism. Errors are logged into a dedicated error table defined by you, capturing key information for debugging and analysis. Take the information that you currently have in the context of the function and log it using the operations properties to the table by defining the data to be logged in the records property.

  • The full error coming back from the backend system should be logged.

  • Expose error tables in Jigx Builder to help with troubleshooting.

  • Define a datasource against the error tables.

Error logging configuration

When configuring REST errors, several system expressions and variables can be used. These variables allow you to dynamically log and handle errors based on the context of the function call. The following context is available to write to the error table, using =@ctx.variable.value:

Variables
Value

commandId

Unique id logged for the item on the commandQueue. The id matches the id in the entity table.

correlationId

The unique identifier that appears in the app. It is used in troubleshooting to help identify specific entries in the logs and to follow the user's journey while using the solution in the app. By filtering logs using this ID, you can troubleshoot issues more effectively.

entity

The specified table where the error context is logged

error

  • message: string

  • title: string

  • description: string

  • details: string

  • icon: string

  • table: string

  • notification: boolean

parameters

Specify any of the parameters in the function to be logged to the error table.

request

  • method: string

  • url: string

  • headers: Record<string, string>

  • body:string

  • Buffer

response

  • ok: boolean

  • status: number

  • statusText: string

  • headers: Record<string, string>

  • body: any

solution

  • id: SolutionId

  • name: SolutionName

  • organizationId: OrganizationId

  • settings:

    • custom: Record<string, unknown>

user

  • id: string

  • email: string

  • displayName: string

  • avatarUrl: string

  • phone: string

  • isVerified: boolean

  • settings: Record<string, unknown>

error:
  # Configure details for each erro status code.
  - when: =@ctx.response.status = 403   
    # Configure the error table and the data to log to the table,
    # in the error section of the function. 
    operations:
      - type: operation.upsert-merge
        table: =@ctx.entity & "_error"
        records: 
          '={ "id": @ctx.commandId, "type": "System Offline", "response": @ctx.response,
          "request": @ctx.request, "user": @ctx.user, "solution": @ctx.solution,
          "entity": @ctx.entity, "correlationId": @ctx.correlationId}'  
        timestamp: remoteSystemTimestamp          

Last updated

Was this helpful?