Skip to content

Commit 3263b85

Browse files
kevin-j-millerJai Bhagat
authored andcommitted
Dev kevin (#192)
* added an informative error message when dat.paths is not present * added an identifier to the error message * Added warnings and errors to deal with the case that hardware.mat is not found * fixed identifier * Changed error identifiers following Miles' suggestion of module:package:function:error * added more info to error for empty rig * added more info to no dat.paths error
1 parent 046cb82 commit 3263b85

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

+hw/devices.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
%% Basic initialisation
2323
fn = fullfile(paths.rigConfig, 'hardware.mat');
2424
if ~file.exists(fn)
25-
rig = [];
25+
warning(['hardware config not found for hostname ', hostname]);
26+
rig = [];
2627
return
2728
end
2829
rig = load(fn);

+srv/expServer.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ function expServer(useTimelineOverride, bgColour)
7373
% get rig hardware
7474
try
7575
rig = hw.devices;
76+
if isempty(rig)
77+
error('rigbox:srv:expServer:noHardwareConfig', ['No hardware config '...
78+
'info found for this rig. Cannot find this rig''s ''hardware.mat'' '...
79+
'file, or hardware config set-up script. Unable to launch '...
80+
'expServer.']);
81+
end
7682
catch ME
7783
fun.applyForce({
7884
@() communicator.close(),...

cortexlab/+git/update.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ function update(scheduled)
1111
% TODO Find quicker way to check for changes
1212
% See also DAT.PATHS
1313

14+
% Check that paths are set up
15+
assert(~isempty(which('dat.paths')), ...
16+
'rigbox:git:update:copyPaths',...
17+
['Error: ''dat.paths'' file not found. Please ensure that a '...
18+
'''dat.paths'' file exists for your setup. A template can be found at '...
19+
'''docs/setup/paths_template''.'])
20+
1421
% If not given as input argument, use 'updateSchedule' in 'dat.paths'. If
1522
% not found, set 'scheduled' to 0.
1623
if nargin < 1; scheduled = getOr(dat.paths, 'updateSchedule', 0); end

0 commit comments

Comments
 (0)