Sets an error on either the global error state or the screen state.
The exception to set as an error.
The severity level of the error.