-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update swagger, add exception log
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
* | ||
*/ | ||
|
||
use oat\oatbox\log\LoggerAwareTrait; | ||
use oat\tao\model\TaoOntology; | ||
|
||
/** | ||
|
@@ -32,6 +33,8 @@ | |
*/ | ||
class taoQtiTest_models_classes_CrudQtiTestsService extends tao_models_classes_CrudService | ||
{ | ||
use LoggerAwareTrait; | ||
|
||
/** (non-PHPdoc) | ||
* @see tao_models_classes_CrudSservice::getClassService() | ||
*/ | ||
|
@@ -106,7 +109,26 @@ public function importQtiTest( | |
|
||
return $report; | ||
} catch (common_exception_UserReadableException $e) { | ||
$this->logException($e); | ||
|
||
return new common_report_Report(common_report_Report::TYPE_ERROR, __($e->getUserMessage())); | ||
} catch (Throwable $exception) { | ||
$this->logException($exception); | ||
|
||
return new common_report_Report(common_report_Report::TYPE_ERROR, __('QTI test import failed')); | ||
} | ||
} | ||
|
||
private function logException(Throwable $exception): void | ||
This comment has been minimized.
Sorry, something went wrong.
gabrielfs7
Contributor
|
||
{ | ||
$this->logError( | ||
sprintf( | ||
'QTI test import failed: %s. File: %s, Line: %s. Stack trace: %s', | ||
$exception->getMessage(), | ||
$exception->getFile(), | ||
$exception->getLine(), | ||
$exception->getTraceAsString() | ||
) | ||
); | ||
} | ||
} |
This comment has been minimized.
Sorry, something went wrong.
gabrielfs7Aug 8, 2024
ContributorThis comment has been minimized.
Sorry, something went wrong.
gabrielfs7Aug 8, 2024
ContributorForget, I see it is a new endpoint. Closing it