Error Handling in Automation

Hai to all, Im integrating Navision with the Sharepoint Portal. when I cancell the connection or while uploading a file from Navision to Sharepoint portal . if i cancel the upload during open menu, this it showing system error…i need to give my customized error. how should i do Regards Shankar.R