Added overridable function for setting error message