In one of my projects I have an entity where the user can upload .gef files. These files are then processed and parsed, and entities are created. However, if the .gef file does not contain complete data the parsing fails and the .gef cannot be uploaded. The user however is only presented with a red cross and Error next to it. Therefore I tried to add a nicer UserError to explain to the user why the .gef cannot be uploaded. My code is as follows (I capture the parsing error with the except clause on line 124):
When I try to upload an incomplete .gef I am now presented with the message in the UserError as wanted but the message is displayed with Error: Error: in front.
I was wondering what I am doing wrong causing the Error: to be displayed twice.