Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
3f80a2c7
Commit
3f80a2c7
authored
Dec 23, 2019
by
Cecilia Vela Gurovic
Committed by
Gerrit Code Review
Dec 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1855771: Allow generic system errors to give more detail"
parents
27b6c8fe
9b35263d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
htdocs/lang/en.utf8/error.php
htdocs/lang/en.utf8/error.php
+1
-0
htdocs/lib/errors.php
htdocs/lib/errors.php
+2
-2
No files found.
htdocs/lang/en.utf8/error.php
View file @
3f80a2c7
...
@@ -81,6 +81,7 @@ $string['invaliddirection'] = 'Invalid direction %s.';
...
@@ -81,6 +81,7 @@ $string['invaliddirection'] = 'Invalid direction %s.';
$string
[
'onlyoneprofileviewallowed'
]
=
'You are only allowed one profile page.'
;
$string
[
'onlyoneprofileviewallowed'
]
=
'You are only allowed one profile page.'
;
$string
[
'cannotputblocktypeintoview'
]
=
'Cannot put %s block types into this page'
;
$string
[
'cannotputblocktypeintoview'
]
=
'Cannot put %s block types into this page'
;
$string
[
'onlyoneblocktypeperview'
]
=
'Cannot put more than one %s block type into a page.'
;
$string
[
'onlyoneblocktypeperview'
]
=
'Cannot put more than one %s block type into a page.'
;
$string
[
'errorat'
]
=
' at '
;
// if you change these next two , be sure to change them in libroot/errors.php
// if you change these next two , be sure to change them in libroot/errors.php
// as they are duplicated there, in the case that get_string was not available.
// as they are duplicated there, in the case that get_string was not available.
...
...
htdocs/lib/errors.php
View file @
3f80a2c7
...
@@ -533,14 +533,14 @@ function error ($code, $message, $file, $line, $vars) {
...
@@ -533,14 +533,14 @@ function error ($code, $message, $file, $line, $vars) {
function
exception
(
$e
)
{
function
exception
(
$e
)
{
$classname
=
get_class
(
$e
);
$classname
=
get_class
(
$e
);
if
(
!
(
$e
instanceof
MaharaException
))
{
if
(
!
(
$e
instanceof
MaharaException
))
{
$e
=
new
SystemException
(
"[
{
$classname
}
]: "
.
$e
->
getMessage
(),
$e
->
getCode
());
$e
=
new
SystemException
(
"[
{
$classname
}
]: "
.
$e
->
getMessage
()
.
get_string
(
'errorat'
,
'error'
)
.
$e
->
getFile
()
.
':'
.
$e
->
getLine
()
,
$e
->
getCode
());
}
}
else
if
(
$classname
==
'MaharaException'
)
{
else
if
(
$classname
==
'MaharaException'
)
{
// Mahara coding practice says not to use MaharaException directly, but for more
// Mahara coding practice says not to use MaharaException directly, but for more
// graceful error handling we have chosen not to make it abstract. Instead, make
// graceful error handling we have chosen not to make it abstract. Instead, make
// it print like a SystemException.
// it print like a SystemException.
/* @var MaharaException $e */
/* @var MaharaException $e */
$e
=
new
SystemException
(
$e
->
getMessage
(),
$e
->
getCode
());
$e
=
new
SystemException
(
$e
->
getMessage
()
.
get_string
(
'errorat'
,
'error'
)
.
$e
->
getFile
()
.
':'
.
$e
->
getLine
()
,
$e
->
getCode
());
}
}
// Display the message and die
// Display the message and die
...
...
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