Files
acceptance-tests
data
debian
docs
HtmlAgilityPack
deploy
sources
mono-api-assembly.html
mono-api-class.html
mono-api-counters.html
mono-api-debug.html
mono-api-domains.html
mono-api-dynamic-codegen.html
mono-api-embedding.html
mono-api-exc.html
mono-api-gc.html
mono-api-gchandle.html
mono-api-image.html
mono-api-internal.html
mono-api-jit.html
mono-api-jitinternal.html
mono-api-metadata.html
mono-api-methods.html
mono-api-object.html
mono-api-profiler.html
mono-api-reflection.html
mono-api-security.html
mono-api-string.html
mono-api-threads.html
mono-api-type.html
mono-api-types.html
mono-api-unsorted.html
mono-api-utils.html
mono-api-vm.html
mono-api-wapi.html
svgs
Makefile.am
Makefile.in
README
TODO
abc-removal.txt
api-style.css
check-coverage
check-exports
convert.cs
docs.make
embedded-api
exdoc
file-share-modes
gc-issues
gc-variables-in-c
glossary.txt
ignore
internal-calls
ir-desc
jit-imt
jit-thoughts
jit-trampolines
mini-doc.txt
mono-api-metadata.html
mono-file-formats.config
mono-file-formats.source
mono-tools.config
mono-tools.source
monoapi.source
object-layout
precise-gc
produce-lists
remoting
ssapre.txt
stack-overflow.txt
threading
toc.xml
unmanaged-calls
external
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
linux-packaging-mono/docs/sources/mono-api-exc.html

83 lines
5.3 KiB
HTML
Raw Normal View History

<h2>Exception Handling</h2>
<p>Mono's exception handling contains methods
to <a href="#creating">create `MonoException*` objects</a>
that can be <a href="api:mono_raise_exception">raised</a>.
<p>Alternatively, you can obtain an exception that you can
raise from some of the most <a href="#common">common</a>
exceptions in the .NET Runtime.
<h3>Raising and Catching exceptions</h3>
<p>If you plan on running your code in Mono's Cooperative mode
for the Garbage Collector (for example, if you are using pure
Bitcode code generation), it you should avoid raising an
exception from any method that is not the entry point to the
internal call.
<p>It is recommended that if you need to raise an error
condition from nested parts of your code, surface this error
to the topmost method that is surfaced as an internal call and
raise the exception there.
<h4><a name="api:mono_raise_exception">mono_raise_exception</a></h4>
<h4><a name="api:mono_unhandled_exception">mono_unhandled_exception</a></h4>
<h4><a name="api:mono_print_unhandled_exception">mono_print_unhandled_exception</a></h4>
<a name="creating"/>
<h3>Exception Types: General API</h3>
<h4><a name="api:mono_exception_from_name_domain">mono_exception_from_name_domain</a></h4>
<h4><a name="api:mono_exception_from_name">mono_exception_from_name</a></h4>
<h4><a name="api:mono_exception_from_name_msg">mono_exception_from_name_msg</a></h4>
<h4><a name="api:mono_exception_from_name_two_strings">mono_exception_from_name_two_strings</a></h4>
<a name="common"/>
<h3>Obtaining Common Exceptions</h3>
<p>There are a number of common exceptions that are used by
the runtime, use the routines in this section to get a copy of
those exceptions.
<h4><a name="api:mono_get_exception_appdomain_unloaded">mono_get_exception_appdomain_unloaded</a></h4>
<h4><a name="api:mono_get_exception_argument">mono_get_exception_argument</a></h4>
<h4><a name="api:mono_get_exception_argument_null">mono_get_exception_argument_null</a></h4>
<h4><a name="api:mono_get_exception_argument_out_of_range">mono_get_exception_argument_out_of_range</a></h4>
<h4><a name="api:mono_get_exception_arithmetic">mono_get_exception_arithmetic</a></h4>
<h4><a name="api:mono_get_exception_array_type_mismatch">mono_get_exception_array_type_mismatch</a></h4>
<h4><a name="api:mono_get_exception_bad_image_format">mono_get_exception_bad_image_format</a></h4>
<h4><a name="api:mono_get_exception_cannot_unload_appdomain">mono_get_exception_cannot_unload_appdomain</a></h4>
<h4><a name="api:mono_get_exception_class">mono_get_exception_class</a></h4>
<h4><a name="api:mono_get_exception_divide_by_zero">mono_get_exception_divide_by_zero</a></h4>
<h4><a name="api:mono_get_exception_execution_engine">mono_get_exception_execution_engine</a></h4>
<h4><a name="api:mono_get_exception_file_not_found2">mono_get_exception_file_not_found2</a></h4>
<h4><a name="api:mono_get_exception_file_not_found">mono_get_exception_file_not_found</a></h4>
<h4><a name="api:mono_get_exception_index_out_of_range">mono_get_exception_index_out_of_range</a></h4>
<h4><a name="api:mono_get_exception_invalid_cast">mono_get_exception_invalid_cast</a></h4>
<h4><a name="api:mono_get_exception_io">mono_get_exception_io</a></h4>
<h4><a name="api:mono_get_exception_missing_method">mono_get_exception_missing_method</a></h4>
<h4><a name="api:mono_get_exception_not_implemented">mono_get_exception_not_implemented</a></h4>
<h4><a name="api:mono_get_exception_null_reference">mono_get_exception_null_reference</a></h4>
<h4><a name="api:mono_get_exception_overflow">mono_get_exception_overflow</a></h4>
<h4><a name="api:mono_get_exception_security">mono_get_exception_security</a></h4>
<h4><a name="api:mono_get_exception_serialization">mono_get_exception_serialization</a></h4>
<h4><a name="api:mono_get_exception_stack_overflow">mono_get_exception_stack_overflow</a></h4>
<h4><a name="api:mono_get_exception_synchronization_lock">mono_get_exception_synchronization_lock</a></h4>
<h4><a name="api:mono_get_exception_thread_abort">mono_get_exception_thread_abort</a></h4>
<h4><a name="api:mono_get_exception_thread_state">mono_get_exception_thread_state</a></h4>
<h4><a name="api:mono_get_exception_type_initialization">mono_get_exception_type_initialization</a></h4>
<h4><a name="api:mono_get_exception_type_load">mono_get_exception_type_load</a></h4>
<h4><a name="api:mono_get_exception_invalid_operation">mono_get_exception_invalid_operation</a></h4>
<h4><a name="api:mono_get_exception_missing_field">mono_get_exception_missing_field</a></h4>
<h4><a name="api:mono_get_exception_not_supported">mono_get_exception_not_supported</a></h4>
<h4><a name="api:mono_get_exception_reflection_type_load">mono_get_exception_reflection_type_load</a></h4>
<h4><a name="api:mono_exception_from_token_two_strings">mono_exception_from_token_two_strings</a></h4>
<h4><a name="api:mono_get_exception_bad_image_format2">mono_get_exception_bad_image_format2</a></h4>
<h4><a name="api:mono_get_exception_field_access">mono_get_exception_field_access</a></h4>
<h4><a name="api:mono_get_exception_method_access">mono_get_exception_method_access</a></h4>
<h4><a name="api:mono_get_exception_out_of_memory">mono_get_exception_out_of_memory</a></h4>
<h4><a name="api:mono_get_exception_runtime_wrapped">mono_get_exception_runtime_wrapped</a></h4>
<h4><a name="api:mono_get_exception_thread_interrupted">mono_get_exception_thread_interrupted</a></h4>