Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
118f67bb
Commit
118f67bb
authored
4 years ago
by
Marc Egger
Browse files
Options
Downloads
Patches
Plain Diff
catch Errors as well as exceptions
parent
86a16097
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!302
Develop
,
!296
Marc: Form/Report As File, Path class, Config class, Typo3 v9 compatability
Pipeline
#4079
passed
4 years ago
Stage: before
Stage: build
Stage: selenium
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extension/Classes/Controller/QfqController.php
+10
-4
10 additions, 4 deletions
extension/Classes/Controller/QfqController.php
extension/Classes/Core/Exception/Thrower.php
+2
-2
2 additions, 2 deletions
extension/Classes/Core/Exception/Thrower.php
with
12 additions
and
6 deletions
extension/Classes/Controller/QfqController.php
+
10
−
4
View file @
118f67bb
...
...
@@ -7,8 +7,6 @@ namespace IMATHUZH\Qfq\Controller;
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
use
http\Exception
;
use
IMATHUZH\Qfq\Core\Helper\Path
;
use
IMATHUZH\Qfq\Core\QuickFormQuery
;
...
...
@@ -67,8 +65,16 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
}
catch
(
\DownloadException
$e
)
{
$html
=
$e
->
formatMessage
();
}
catch
(
Exception
$e
)
{
$html
=
"Generic Exception: "
.
$e
->
getMessage
();
}
catch
(
\Exception
$e
)
{
$ee
=
new
\UserReportException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
"Generic Exception: "
.
$e
->
getMessage
(),
ERROR_MESSAGE_TO_DEVELOPER
=>
$e
->
getTraceAsString
()]),
E_ERROR
);
$html
=
$ee
->
formatMessage
();
}
catch
(
\Error
$e
)
{
$ee
=
new
\UserReportException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
"Generic Error: "
.
$e
->
getMessage
(),
ERROR_MESSAGE_TO_DEVELOPER
=>
$e
->
getTraceAsString
()]),
E_ERROR
);
$html
=
$ee
->
formatMessage
();
}
if
(
isset
(
$e
)
&&
$e
->
getCode
()
==
ERROR_QUIT_QFQ_REGULAR
)
{
...
...
This diff is collapsed.
Click to expand it.
extension/Classes/Core/Exception/Thrower.php
+
2
−
2
View file @
118f67bb
...
...
@@ -15,7 +15,7 @@ class Thrower
public
static
function
userFormException
(
string
$errorToUser
,
string
$errorToDeveloper
=
''
,
int
$errorCode
=
E_ERROR
)
{
throw
new
\UserFormException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
$errorToUser
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$errorToDeveloper
]),
ERROR_IO_READ_FILE
);
ERROR_MESSAGE_TO_DEVELOPER
=>
$errorToDeveloper
]),
$errorCode
);
}
/**
...
...
@@ -29,6 +29,6 @@ class Thrower
public
static
function
userReportException
(
string
$errorToUser
,
string
$errorToDeveloper
=
''
,
int
$errorCode
=
E_ERROR
)
{
throw
new
\UserReportException
(
json_encode
([
ERROR_MESSAGE_TO_USER
=>
$errorToUser
,
ERROR_MESSAGE_TO_DEVELOPER
=>
$errorToDeveloper
]),
ERROR_IO_READ_FILE
);
ERROR_MESSAGE_TO_DEVELOPER
=>
$errorToDeveloper
]),
$errorCode
);
}
}
\ No newline at end of file
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