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
b17f2683
Commit
b17f2683
authored
9 years ago
by
Jesús Macias
Committed by
Morris Jobke
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add different storage status codes managed by StoragedNotAvailableException
parent
c6bda8d6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_external/controller/storagescontroller.php
+38
-4
38 additions, 4 deletions
apps/files_external/controller/storagescontroller.php
apps/files_external/lib/config.php
+4
-0
4 additions, 0 deletions
apps/files_external/lib/config.php
with
42 additions
and
4 deletions
apps/files_external/controller/storagescontroller.php
+
38
−
4
View file @
b17f2683
...
@@ -242,10 +242,44 @@ abstract class StoragesController extends Controller {
...
@@ -242,10 +242,44 @@ abstract class StoragesController extends Controller {
$this
->
l10n
->
t
(
'Insufficient data: %s'
,
[
$e
->
getMessage
()])
$this
->
l10n
->
t
(
'Insufficient data: %s'
,
[
$e
->
getMessage
()])
);
);
}
catch
(
StorageNotAvailableException
$e
)
{
}
catch
(
StorageNotAvailableException
$e
)
{
$storage
->
setStatus
(
switch
(
$e
->
getCode
())
{
\OC_Mount_Config
::
STATUS_ERROR
,
case
1
:
$e
->
getMessage
()
$storage
->
setStatus
(
);
\OC_Mount_Config
::
STATUS_ERROR
,
$this
->
l10n
->
t
(
'%s'
,
[
$e
->
getMessage
()])
);
break
;
case
3
:
$storage
->
setStatus
(
\OC_Mount_Config
::
STATUS_INCOMPLETE_CONF
,
$this
->
l10n
->
t
(
'Incomplete configuration. %s'
,
[
$e
->
getMessage
()])
);
break
;
case
4
:
$storage
->
setStatus
(
\OC_Mount_Config
::
STATUS_UNAUTHORIZED
,
$this
->
l10n
->
t
(
'Unauthorized. %s'
,
[
$e
->
getMessage
()])
$e
->
getMessage
()
);
break
;
case
5
:
$storage
->
setStatus
(
\OC_Mount_Config
::
STATUS_TIMEOUT
,
$this
->
l10n
->
t
(
'Timeout. %s'
,
[
$e
->
getMessage
()])
);
break
;
case
6
:
$storage
->
setStatus
(
\OC_Mount_Config
::
STATUS_NETWORK_ERROR
,
$this
->
l10n
->
t
(
'Network error. %s'
,
[
$e
->
getMessage
()])
);
break
;
default
:
$storage
->
setStatus
(
\OC_Mount_Config
::
STATUS_ERROR
,
$this
->
l10n
->
t
(
'%s'
,
[
$e
->
getMessage
()])
);
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
// FIXME: convert storage exceptions to StorageNotAvailableException
// FIXME: convert storage exceptions to StorageNotAvailableException
$storage
->
setStatus
(
$storage
->
setStatus
(
...
...
This diff is collapsed.
Click to expand it.
apps/files_external/lib/config.php
+
4
−
0
View file @
b17f2683
...
@@ -52,6 +52,10 @@ class OC_Mount_Config {
...
@@ -52,6 +52,10 @@ class OC_Mount_Config {
const
STATUS_SUCCESS
=
0
;
const
STATUS_SUCCESS
=
0
;
const
STATUS_ERROR
=
1
;
const
STATUS_ERROR
=
1
;
const
STATUS_INDETERMINATE
=
2
;
const
STATUS_INDETERMINATE
=
2
;
const
STATUS_INCOMPLETE_CONF
=
3
;
const
STATUS_UNAUTHORIZED
=
4
;
const
STATUS_TIMEOUT
=
5
;
const
STATUS_NETWORK_ERROR
=
6
;
// whether to skip backend test (for unit tests, as this static class is not mockable)
// whether to skip backend test (for unit tests, as this static class is not mockable)
public
static
$skipTest
=
false
;
public
static
$skipTest
=
false
;
...
...
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