I have a workflow task that can be pulled to fullfil business logic which means that task is no more valid. There is workflow task approval form to allow user to approve\reject the task but when the task is pulled and user clicks on the task link to open it, it displays a detailed default SharePoint error message saying the "No item exists at ....(URL)....followed by detailed error message and then Correlation ID and Date and Time." See below screen capture.
var value = SP.UI.ModalDialog.showWaitScreenWithNoClose("Please wait", "Please wait while approval is being processed...", 100, 300);
My question is, is there a way, I can trap the error message and show a short and user friendly error message from here? Appreciate your responses or any references. Let me know if any additional information is required.