Skip to content

Commit

Permalink
[bug] fix error_pos error when giving a non-existant input file
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Mar 24, 2024
1 parent d69686d commit ee830cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions loadbj.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
elseif (~isempty(fname) && any(fname(1) == '[{SCHiUIulmLMhdDTFZN'))
string = fname;
else
error_pos('input file does not exist or buffer is invalid');
error('input file does not exist or buffer is invalid');
end

pos = 1;
Expand Down Expand Up @@ -256,7 +256,7 @@
[cc, pos] = next_char(inputstr, pos);
if (cc == '[')
if (isfield(varargin{1}, 'noembedding_') && varargin{1}.noembedding_ == 1)
error_pos('ND array size specifier does not support embedding');
error_pos('ND array size specifier does not support embedding', inputstr, pos);
end
varargin{1}.noembedding_ = 1;
[dim, pos] = parse_array(inputstr, pos, varargin{:});
Expand Down
2 changes: 1 addition & 1 deletion loadjson.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
elseif (regexpi(fname, '^\s*(http|https|ftp|file)://'))
string = urlread(fname);
else
error_pos('input file does not exist');
error('input file does not exist');
end

if (jsonopt('BuiltinJSON', 0, opt) && exist('jsondecode', 'builtin'))
Expand Down

0 comments on commit ee830cd

Please sign in to comment.