Skip to content

Commit e6354ea

Browse files
committed
refactor checkAbort
1 parent 99aaae4 commit e6354ea

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

checkAbort.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ function checkAbort(cfg, deviceNumber)
2929

3030
if keyIsDown && keyCode(KbName(cfg.keyboard.escapeKey))
3131

32-
errorStruct.message = 'Escape key press detected: aborting experiment.';
33-
errorStruct.identifier = 'checkAbort:abortRequested';
34-
35-
error(errorStruct)
32+
errorAbort();
3633

3734
end
3835

errorAbort.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function errorAbort
2+
errorStruct.message = 'Escape key press detected: aborting experiment.';
3+
errorStruct.identifier = 'checkAbort:abortRequested';
4+
5+
error(errorStruct)
6+
end

0 commit comments

Comments
 (0)