Comment on page

Bubble

Bubble FAQ
How do I properly handle docMaker errors in Bubble?
In order to handle errors in your workflows:
- if you are using a button to trigger docMaker actions, you will have to set-up a specific workflow to catch errors on this button's workflow, using the custom event : "An element has an error running a workflow" for this button. Then display to your user the Currrent workflow error's message, and also add it to your logs table (if you have one in your app) for future reference.
- in addition to that, if you use a webhook : when initializing the webhook you will see that there are a status code and a message in the JSON received from docMaker. Example of successful message to webhook :
{
"success": true,
"statusCode": 200,
"message": "file created successfully",
"result_file": "//3611f468aafc8649dcc4ec273e00346a.cdn.bubble.io/f1693992574960x341126990077366140/result4.pdf",
"filename": "result4.pdf",
"object_id": "abc",
"object_type": "type_abc"
}
With this you can implement an error management, by testing if "success" = false, then there is an error. In this case you can display the statusCode and message to your user, and also add them to your logs for future reference.Example of error response sent to webhook:
{
"success": false,
"status_code": 403,
"message": "Client error message: missing template, please provide template URL or ID",
"result_file": "error",
"filename": "error",
"object_id": "abc",
"object_type": "type_abc"
}