mirror of https://github.com/MISP/MISP
fix: [cleanup] Some cleanup and fixes to invalid exception invocations
parent
e034eab1bf
commit
7624149224
|
@ -2117,7 +2117,7 @@ class AttributesController extends AppController
|
|||
$returnFormat = 'json';
|
||||
}
|
||||
if (!isset($validFormats[$returnFormat][1])) {
|
||||
throw new MethodNotFoundException('Invalid output format.');
|
||||
throw new NotFoundException('Invalid output format.');
|
||||
}
|
||||
App::uses($validFormats[$returnFormat][1], 'Export');
|
||||
$exportTool = new $validFormats[$returnFormat][1]();
|
||||
|
|
|
@ -3044,12 +3044,8 @@ class EventsController extends AppController
|
|||
if ($returnFormat === 'download') {
|
||||
$returnFormat = 'json';
|
||||
}
|
||||
if (!isset($validFormats[$returnFormat])) {
|
||||
// this is where the new code path for the export modules will go
|
||||
throw new MethodNotFoundException('Invalid export format.');
|
||||
}
|
||||
if (!isset($validFormats[$returnFormat][1])) {
|
||||
throw new MethodNotFoundException('Invalid output format.');
|
||||
throw new NotFoundException('Invalid output format.');
|
||||
}
|
||||
App::uses($validFormats[$returnFormat][1], 'Export');
|
||||
$exportTool = new $validFormats[$returnFormat][1]();
|
||||
|
|
Loading…
Reference in New Issue