Skip to content

Commit 7b978e9

Browse files
committed
Improve error messages for input argument type checks
Updated error messages in GannetCoRegister, GannetFit, GannetQuantify, GannetSegment, and PaperPlot to specify the received input type when the first argument is not a structure. Also updated the version string in GannetQuantify to '250911'.
1 parent d4b0dc1 commit 7b978e9

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

GannetCoRegister.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
if ~isstruct(MRS_struct)
1414
fprintf('\n');
15-
error('The first input argument ''%s'' must be a structure.', MRS_struct);
15+
error('The first input argument must be a structure, but received %s.', class(MRS_struct));
1616
end
1717

1818
if nargin == 2

GannetFit.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if ~isstruct(MRS_struct)
1010
fprintf('\n');
11-
error('The first input argument ''%s'' must be a structure.', MRS_struct);
11+
error('The first input argument must be a structure, but received %s.', class(MRS_struct));
1212
end
1313

1414
MRS_struct.info.datetime.fit = datetime('now');

GannetQuantify.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
if ~isstruct(MRS_struct)
1010
fprintf('\n');
11-
error('The first input argument ''%s'' must be a structure.', MRS_struct);
11+
error('The first input argument must be a structure, but received %s.', class(MRS_struct));
1212
end
1313

1414
MRS_struct.info.datetime.quantify = datetime('now');
15-
MRS_struct.info.version.quantify = '250910';
15+
MRS_struct.info.version.quantify = '250911';
1616

1717
if MRS_struct.p.PRIAM
1818
vox = MRS_struct.p.vox;

GannetSegment.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
if ~isstruct(MRS_struct)
1515
fprintf('\n');
16-
error('The first input argument ''%s'' must be a structure.', MRS_struct);
16+
error('The first input argument must be a structure, but received %s.', class(MRS_struct));
1717
end
1818

1919
MRS_struct.info.datetime.segment = datetime('now');

PaperPlot.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function PaperPlot(MRS_struct, varargin)
6969

7070
if ~isstruct(MRS_struct)
7171
fprintf('\n');
72-
error('The first input argument ''%s'' must be a structure.', MRS_struct);
72+
error('The first input argument must be a structure, but received %s.', class(MRS_struct));
7373
end
7474

7575
% Set some defaults

0 commit comments

Comments
 (0)