# Appendix C: Function Error Responses

## Understanding Error Responses

Every function in UPLOADit returns a response indicating the success or failure of that function. If the function is successful, it will return a response indicating that it set the value you were trying to set, completed the task that needed to be completed, or return the information that you requested. If however, the function is not successful, it will return an Error Response. This Error Response will be in the form:

1. ERROR: <Function Name>: <Error Description>

Figure C.1 Error Response Example

For example, if you call the Upld-DeleteRealm function without specifying a parameter, the function would return the following Error Response:

1. ERROR: DeleteRealm: You must specify the name of the Realm to Delete.

Figure C.2 Error Response Example

Error Responses always start with the word "ERROR" in all caps, followed by a colon, followed by the function that had the error, followed by a colon, followed by the actual error that occurred. You can use the various FileMaker Calculation Text Functions to extract the different parts of the Error Response for your own use. For instance, if you want to know if the response you received from a function was an error, you can use the LeftWords() Calculation function to return the first word and see if it is "ERROR". An example of this is as follows:

1. Set Field [Result, External("Upld-DeleteRealm, "myrealm"]
2. If [LeftWords(Result, 1) = "ERROR"]
3. Show Message ["Could not delete realm"]
4. Else
5. Show Message ["The realm was deleted."]
6. End If

Figure C.3 Error Response Script