Try catch together with dbstop
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi All,
I want to use Try Catch together with dbstop. What I want to do is to email ME.message and then breakpoint on error with "dbstop if all error"
function myFunction()
try
xxxx
xxxxxx
xxxx (error occure here!)
xxxxx
catch ME
EmailMe(ME.message);
dbstop if all error
end
Note that after try (xxxx), there are several functions that I cannot repeat the code after "dbstop if all error".
If I put "dbstop if all error" at the begining, then cannot email "ME.message".
Any solusion to this issue?!
댓글 수: 0
채택된 답변
Walter Roberson
2019년 8월 15일
Instead of using dbstop at that point, use keyboard() which gives you a command prompt in debug mode.
댓글 수: 0
추가 답변 (1개)
Sonima
2019년 8월 15일
댓글 수: 1
Walter Roberson
2019년 8월 15일
keyboard gives you a command prompt in a debugging session. dbstop calls keyboard() when it detects an error.
dbstop only applies to later errors, not to any error condition you are already in the catch block of.
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!