Exit the function when an error occurs, and move the rest of the following code one indent level left.
Attach a file by drag & drop or click to upload