Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
5ab5a5f8
Unverified
Commit
5ab5a5f8
authored
4 years ago
by
Christoph Wurst
Browse files
Options
Downloads
Patches
Plain Diff
Catch all exceptions when an app is registering or booting
Signed-off-by:
Christoph Wurst
<
christoph@winzerhof-wurst.at
>
parent
e64e2d66
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/AppFramework/Bootstrap/Coordinator.php
+15
-1
15 additions, 1 deletion
lib/private/AppFramework/Bootstrap/Coordinator.php
with
15 additions
and
1 deletion
lib/private/AppFramework/Bootstrap/Coordinator.php
+
15
−
1
View file @
5ab5a5f8
...
@@ -32,6 +32,7 @@ use OCP\AppFramework\QueryException;
...
@@ -32,6 +32,7 @@ use OCP\AppFramework\QueryException;
use
OCP\EventDispatcher\IEventDispatcher
;
use
OCP\EventDispatcher\IEventDispatcher
;
use
OCP\ILogger
;
use
OCP\ILogger
;
use
OCP\IServerContainer
;
use
OCP\IServerContainer
;
use
Throwable
;
use
function
class_exists
;
use
function
class_exists
;
use
function
class_implements
;
use
function
class_implements
;
use
function
in_array
;
use
function
in_array
;
...
@@ -81,9 +82,17 @@ class Coordinator {
...
@@ -81,9 +82,17 @@ class Coordinator {
try
{
try
{
/** @var IBootstrap|App $application */
/** @var IBootstrap|App $application */
$apps
[
$appId
]
=
$application
=
$this
->
serverContainer
->
query
(
$applicationClassName
);
$apps
[
$appId
]
=
$application
=
$this
->
serverContainer
->
query
(
$applicationClassName
);
$application
->
register
(
$context
->
for
(
$appId
));
}
catch
(
QueryException
$e
)
{
}
catch
(
QueryException
$e
)
{
// Weird, but ok
// Weird, but ok
return
;
}
try
{
$application
->
register
(
$context
->
for
(
$appId
));
}
catch
(
Throwable
$e
)
{
$this
->
logger
->
logException
(
$e
,
[
'message'
=>
'Error during app service registration: '
.
$e
->
getMessage
(),
'level'
=>
ILogger
::
FATAL
,
]);
}
}
}
}
}
}
...
@@ -125,6 +134,11 @@ class Coordinator {
...
@@ -125,6 +134,11 @@ class Coordinator {
'message'
=>
"Could not boot
$appId
"
.
$e
->
getMessage
(),
'message'
=>
"Could not boot
$appId
"
.
$e
->
getMessage
(),
]);
]);
return
;
return
;
}
catch
(
Throwable
$e
)
{
$this
->
logger
->
logException
(
$e
,
[
'message'
=>
"Could not boot
$appId
"
.
$e
->
getMessage
(),
'level'
=>
ILogger
::
FATAL
,
]);
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment