ForNext
Only Do What Only You Can Do
099. catch exception
Hyperpolyglot C++ Style Languages: C++, Objective C, Java, C# より (2012.05.08)
VBScript
JScript
Perl
PHP
Python
Ruby
PowerShell
Scala
F#
C
C++
try { throw exception(); } catch (exception& e) { cout << "failed" << endl; }
C++Builder
VC++
C#
try { throw new System.Exception("failed"); } catch (System.Exception e) { System.Console.WriteLine(e.Message); }
Java
try { throw new Exception("failed"); } catch (Exception e) { System.out.println(e.getMessage()); }
Objective-C
@try { [NSException raise:@"error" format:@"failed"]; } @catch (NSException *e) { printf([[e reason] UTF8String]); }