Returning error message set via setError() when calling getError()

I had some tests in my project which were checking if the error message has been set using getError(). Apparently, the method wasn't implemented, so I added it along with a small unit test to verify the fix.