Code

Split getException into method and function, so it can be used in native functions.