diff options
-rw-r--r-- | mono/utils/mono-error-internals.h | 4 | ||||
-rw-r--r-- | mono/utils/mono-error.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mono/utils/mono-error-internals.h b/mono/utils/mono-error-internals.h index 926e76c9bbd..d16f9ef6602 100644 --- a/mono/utils/mono-error-internals.h +++ b/mono/utils/mono-error-internals.h @@ -40,7 +40,9 @@ typedef struct { #define is_ok(error) ((error)->error_code == MONO_ERROR_NONE) void -mono_error_assert_ok (MonoError *error); +mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno); + +#define mono_error_assert_ok(e) mono_error_assert_ok_pos (e, __FILE__, __LINE__); void mono_error_dup_strings (MonoError *error, gboolean dup_strings); diff --git a/mono/utils/mono-error.c b/mono/utils/mono-error.c index 4ab45ba9e2c..5673719059b 100644 --- a/mono/utils/mono-error.c +++ b/mono/utils/mono-error.c @@ -119,12 +119,12 @@ mono_error_ok (MonoError *error) } void -mono_error_assert_ok (MonoError *error) +mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno) { if (mono_error_ok (error)) return; - g_error ("%s\n", mono_error_get_message (error)); + g_error ("%s:%d: %s\n", filename, lineno, mono_error_get_message (error)); } unsigned short |