From 30223ad01d2263c3a3b5bb1b6386b520fdac3b3d Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Thu, 29 Jun 2017 12:52:15 -0400 Subject: [PATCH] [mono-error] Add mono_error_set_file_not_found To throw System.IO.FileNotFoundException --- mono/utils/mono-error-internals.h | 3 +++ mono/utils/mono-error.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/mono/utils/mono-error-internals.h b/mono/utils/mono-error-internals.h index aa264a70a78..e3402353ff5 100644 --- a/mono/utils/mono-error-internals.h +++ b/mono/utils/mono-error-internals.h @@ -123,6 +123,9 @@ mono_error_set_not_supported (MonoError *error, const char *msg_format, ...) MON void mono_error_set_invalid_operation (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3); +void +mono_error_set_file_not_found (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3); + void mono_error_set_exception_instance (MonoError *error, MonoException *exc); diff --git a/mono/utils/mono-error.c b/mono/utils/mono-error.c index 2186c59a78e..e193291a569 100644 --- a/mono/utils/mono-error.c +++ b/mono/utils/mono-error.c @@ -459,6 +459,20 @@ mono_error_set_invalid_operation (MonoError *oerror, const char *msg_format, ... va_end (args); } +/** + * mono_error_set_file_not_found: + * + * System.IO.FileNotFoundException + */ +void +mono_error_set_file_not_found (MonoError *oerror, const char *msg_format, ...) +{ + va_list args; + va_start (args, msg_format); + mono_error_set_generic_errorv (oerror, "System.IO", "FileNotFoundException", msg_format, args); + va_end (args); +} + void mono_error_set_invalid_program (MonoError *oerror, const char *msg_format, ...) { -- 2.25.1