-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdsprinterr_noglobal.m
More file actions
executable file
·38 lines (37 loc) · 987 Bytes
/
dsprinterr_noglobal.m
File metadata and controls
executable file
·38 lines (37 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% Author: Carl Doersch (cdoersch at cs dot cmu dot edu)
%
% print the exception named ex. If we are running in a distributed setting,
% rethrow the exception so it can be reported in the main thread. Otherwise
% go to a keyboard statement for debugging.
%function dsprinterr(ds_err)
%ds_err=lasterror;
%disp(ds_err.message);
%for(i=1:numel(ds_err.stack))
% disp(ds_err.stack(i));
%end;
%disp(ds_err.identifier);
%if(~exist('ds','var'))
% global ds;
%end
%global ds;
ismapreducer=dsbool(ds,'sys','distproc','mapreducer');
if(~ismapreducer)
dsstacktrace(ex);
try
cwd=dspwd;
if(~strcmp(cwd,'.ds'));
disp(['WARNING: current ds wd is: ' cwd '!!']);
end
catch,end
if(isdeployed)
disp('dskeyboard. use rethrow(ex) to get back to prompt');
rethrow(ex);
else
keyboard
end
else
%ex2=MException('ds:dsprinterrdummy','dsprinterr received an error and couldn''t call keyboard, threw this instead.');
%ex2.addCause(ds_err);
rethrow(ex);
end
%end