Programming Erlang读书笔记4: Exceptions

语法:
try FuncOrExpressionSequence of
  Pattern1 [when Guard1] -> Expressions1;
  Pattern2 [when Guard2] -> Expressions2;
  ...
catch
  ExceptionType: ExPattern1 [when ExGuard1] -> ExExpressions1;
  ExceptionType: ExPattern2 [when ExGuard2] -> ExExpressions2;
  ...
after
  AfterExpressions
end


一些BIFs:
exit(Why)
throw(Why)
erlang:error(Why)
erlang:get_stacktrace()

你可能感兴趣的:(erlang,读书)