I think it would make sense changing the "error" field to a map of:
- severity (warning or error)
- message
- location
- source file name (or pointer to the source object / identifier)
- source line
The improvement would be twofold:
- No need to manually trying to assess the severity
- Proper link to the source file