wrap errors in createErrorMessage