Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
bb465a7a
Commit
bb465a7a
authored
Jun 20, 2016
by
Robin Appelman
Committed by
Thomas Müller
Jun 20, 2016
Browse files
Catch exceptions while creating shared mounts (#25077)
parent
dcee5284
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/files_sharing/lib/AppInfo/Application.php
View file @
bb465a7a
...
...
@@ -115,7 +115,8 @@ class Application extends App {
$server
=
$c
->
query
(
'ServerContainer'
);
return
new
MountProvider
(
$server
->
getConfig
(),
$server
->
getShareManager
()
$server
->
getShareManager
(),
$server
->
getLogger
()
);
});
...
...
apps/files_sharing/lib/MountProvider.php
View file @
bb465a7a
...
...
@@ -26,6 +26,7 @@ namespace OCA\Files_Sharing;
use
OCP\Files\Config\IMountProvider
;
use
OCP\Files\Storage\IStorageFactory
;
use
OCP\IConfig
;
use
OCP\ILogger
;
use
OCP\IUser
;
use
OCP\Share\IManager
;
...
...
@@ -40,13 +41,20 @@ class MountProvider implements IMountProvider {
*/
protected
$shareManager
;
/**
* @var ILogger
*/
protected
$logger
;
/**
* @param \OCP\IConfig $config
* @param IManager $shareManager
* @param ILogger $logger
*/
public
function
__construct
(
IConfig
$config
,
IManager
$shareManager
)
{
public
function
__construct
(
IConfig
$config
,
IManager
$shareManager
,
ILogger
$logger
)
{
$this
->
config
=
$config
;
$this
->
shareManager
=
$shareManager
;
$this
->
logger
=
$logger
;
}
...
...
@@ -67,15 +75,20 @@ class MountProvider implements IMountProvider {
$mounts
=
[];
foreach
(
$shares
as
$share
)
{
$mounts
[]
=
new
SharedMount
(
'\OC\Files\Storage\Shared'
,
$mounts
,
[
'user'
=>
$user
->
getUID
(),
'newShare'
=>
$share
,
],
$storageFactory
);
try
{
$mounts
[]
=
new
SharedMount
(
'\OC\Files\Storage\Shared'
,
$mounts
,
[
'user'
=>
$user
->
getUID
(),
'newShare'
=>
$share
,
],
$storageFactory
);
}
catch
(
\
Exception
$e
)
{
$this
->
logger
->
logException
(
$e
);
$this
->
logger
->
error
(
'Error while trying to create shared mount'
);
}
}
// array_filter removes the null values from the array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment