Restructure of mono.sln and build properties to better fix static/dynamic library...
[mono.git] / docs / sources / mono-api-exc.html
1 <h2>Exception Handling</h2>
2
3         <p>Mono's exception handling contains methods
4         to <a href="#creating">create `MonoException*` objects</a>
5         that can be <a href="api:mono_raise_exception">raised</a>.
6
7         <p>Alternatively, you can obtain an exception that you can
8         raise from some of the most <a href="#common">common</a>
9         exceptions in the .NET Runtime.
10         
11 <h3>Raising and Catching exceptions</h3>
12
13         <p>If you plan on running your code in Mono's Cooperative mode
14         for the Garbage Collector (for example, if you are using pure
15         Bitcode code generation), it you should avoid raising an
16         exception from any method that is not the entry point to the
17         internal call. 
18
19         <p>It is recommended that if you need to raise an error
20         condition from nested parts of your code, surface this error
21         to the topmost method that is surfaced as an internal call and
22         raise the exception there.
23
24         
25 <h4><a name="api:mono_raise_exception">mono_raise_exception</a></h4>
26 <h4><a name="api:mono_unhandled_exception">mono_unhandled_exception</a></h4>
27 <h4><a name="api:mono_print_unhandled_exception">mono_print_unhandled_exception</a></h4>
28
29 <a name="creating"/>
30 <h3>Exception Types: General API</h3>
31
32 <h4><a name="api:mono_exception_from_name_domain">mono_exception_from_name_domain</a></h4>
33 <h4><a name="api:mono_exception_from_name">mono_exception_from_name</a></h4>
34 <h4><a name="api:mono_exception_from_name_msg">mono_exception_from_name_msg</a></h4>
35 <h4><a name="api:mono_exception_from_name_two_strings">mono_exception_from_name_two_strings</a></h4>
36
37 <a name="common"/>
38 <h3>Obtaining Common Exceptions</h3>
39
40         <p>There are a number of common exceptions that are used by
41         the runtime, use the routines in this section to get a copy of
42         those exceptions.
43         
44 <h4><a name="api:mono_get_exception_appdomain_unloaded">mono_get_exception_appdomain_unloaded</a></h4>
45 <h4><a name="api:mono_get_exception_argument">mono_get_exception_argument</a></h4>
46 <h4><a name="api:mono_get_exception_argument_null">mono_get_exception_argument_null</a></h4>
47 <h4><a name="api:mono_get_exception_argument_out_of_range">mono_get_exception_argument_out_of_range</a></h4>
48 <h4><a name="api:mono_get_exception_arithmetic">mono_get_exception_arithmetic</a></h4>
49 <h4><a name="api:mono_get_exception_array_type_mismatch">mono_get_exception_array_type_mismatch</a></h4>
50 <h4><a name="api:mono_get_exception_bad_image_format">mono_get_exception_bad_image_format</a></h4>
51 <h4><a name="api:mono_get_exception_cannot_unload_appdomain">mono_get_exception_cannot_unload_appdomain</a></h4>
52 <h4><a name="api:mono_get_exception_class">mono_get_exception_class</a></h4>
53 <h4><a name="api:mono_get_exception_divide_by_zero">mono_get_exception_divide_by_zero</a></h4>
54 <h4><a name="api:mono_get_exception_execution_engine">mono_get_exception_execution_engine</a></h4>
55 <h4><a name="api:mono_get_exception_file_not_found2">mono_get_exception_file_not_found2</a></h4>
56 <h4><a name="api:mono_get_exception_file_not_found">mono_get_exception_file_not_found</a></h4>
57 <h4><a name="api:mono_get_exception_index_out_of_range">mono_get_exception_index_out_of_range</a></h4>
58 <h4><a name="api:mono_get_exception_invalid_cast">mono_get_exception_invalid_cast</a></h4>
59 <h4><a name="api:mono_get_exception_io">mono_get_exception_io</a></h4>
60 <h4><a name="api:mono_get_exception_missing_method">mono_get_exception_missing_method</a></h4>
61 <h4><a name="api:mono_get_exception_not_implemented">mono_get_exception_not_implemented</a></h4>
62 <h4><a name="api:mono_get_exception_null_reference">mono_get_exception_null_reference</a></h4>
63 <h4><a name="api:mono_get_exception_overflow">mono_get_exception_overflow</a></h4>
64 <h4><a name="api:mono_get_exception_security">mono_get_exception_security</a></h4>
65 <h4><a name="api:mono_get_exception_serialization">mono_get_exception_serialization</a></h4>
66 <h4><a name="api:mono_get_exception_stack_overflow">mono_get_exception_stack_overflow</a></h4>
67 <h4><a name="api:mono_get_exception_synchronization_lock">mono_get_exception_synchronization_lock</a></h4>
68 <h4><a name="api:mono_get_exception_thread_abort">mono_get_exception_thread_abort</a></h4>
69 <h4><a name="api:mono_get_exception_thread_state">mono_get_exception_thread_state</a></h4>
70 <h4><a name="api:mono_get_exception_type_initialization">mono_get_exception_type_initialization</a></h4>
71 <h4><a name="api:mono_get_exception_type_load">mono_get_exception_type_load</a></h4>
72 <h4><a name="api:mono_get_exception_invalid_operation">mono_get_exception_invalid_operation</a></h4>
73 <h4><a name="api:mono_get_exception_missing_field">mono_get_exception_missing_field</a></h4>
74 <h4><a name="api:mono_get_exception_not_supported">mono_get_exception_not_supported</a></h4>
75 <h4><a name="api:mono_get_exception_reflection_type_load">mono_get_exception_reflection_type_load</a></h4>
76 <h4><a name="api:mono_exception_from_token_two_strings">mono_exception_from_token_two_strings</a></h4>
77 <h4><a name="api:mono_get_exception_bad_image_format2">mono_get_exception_bad_image_format2</a></h4>
78 <h4><a name="api:mono_get_exception_field_access">mono_get_exception_field_access</a></h4>
79 <h4><a name="api:mono_get_exception_method_access">mono_get_exception_method_access</a></h4>
80 <h4><a name="api:mono_get_exception_out_of_memory">mono_get_exception_out_of_memory</a></h4>
81 <h4><a name="api:mono_get_exception_runtime_wrapped">mono_get_exception_runtime_wrapped</a></h4>
82 <h4><a name="api:mono_get_exception_thread_interrupted">mono_get_exception_thread_interrupted</a></h4>