Skip to content

Commit

Permalink
fix(errormsg): put line error in single line
Browse files Browse the repository at this point in the history
  • Loading branch information
ocehugo committed Apr 1, 2021
1 parent 10de06b commit d78fc69
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Util/errormsg.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ function errormsg(msg,varargin)

cstack = dbstack;
if numel(cstack) == 1
name = cstack(1).name;
n = 1;
else
name = cstack(2).name;
n = 2;
end
name = cstack(n).name;
line = cstack(n).line;

actualmsg = sprintf(msg,varargin{:});
actualmsg = sprintf([name '(' num2str(line) '):' msg],varargin{:});
dotsplit = split(name,'.');
if numel(dotsplit) == 1
name_as_id = sprintf('%s:%s',dotsplit{1},dotsplit{1});
Expand Down

0 comments on commit d78fc69

Please sign in to comment.