App error not showing up in JSON Panel

Hi!
I need to notify the user to re-authorize to the integrated system but unfortunately the provided error information doesn’t show up in the JSON Panel.
From my api I return a json according to the documentation here: Adding a JSON panel (readme.io).
But the only thing showing up to the user is this:
image

Example of json returned from my api:

{
	"error": {
		"title": "Not authorized",
		"subtitle": "Please click the button below to authorize, then try and reload this app panel.",
		"action": {
			"url": "https://[server]/appstore/install",
			"label": "Authorize"
		}
	}
}

Please help me understand how to show a friendly error message to the user.

Best regards

Gunnar

Hello there @stonesvillage, welcome to the community!

While trying your error payload with my test app, the message was displayed normally in the panel. One thing I can think of is the status code, which one is returned in the response? It should work with 300 and above.
If that’s not the case, can you access the endpoint via curl or postman? How the response looks?

Hello @Edmilson_Souza I have the same issue with a code 300 or 400.

I am doing a simple :

  return NextResponse.json(
    {
      error: {
        title: 'Configuration requise',
        subtitle:
          'Please click the button below to authorize, then try and reload this app panel.',
        action: {
          url: setupUrl,
          label: 'Configurer',
        },
      },
    },
    { status: 400 }
  )

The call to
https://XXX.pipedrive.com/api/v1/marketplace-extensions/panels/af2533bf-fe08-4524-8b19-1b4dc80556e6?resource=deal&view=details&userId=17941139&companyId&selectedIds=2&session_token=XXX&strict_mode=true

Has response :

{
    "success": true,
    "data": {
        "vendorError": true,
        "error": {
            "title": "Configuration requise",
            "subtitle": "Please click the button below to authorize, then try and reload this app panel.",
            "action": {
                "url": "https://app.heybilly.io/setup/pennylane/pipedrive",
                "label": "Configurer"
            }
        }
    },
    "additional_data": null
}

But it’s a general error that is shown on the JSON Panel :

Best regards,

This is working now, maybe it’s cached or something. We can close the issue for me.

2 Likes