Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
druid-public
headwork
Commits
46d6f644
Commit
46d6f644
authored
Apr 21, 2021
by
GROSS-AMBLARD David
Browse files
Adds a global try/catch block to handle any exception.
parent
09550713
Changes
3
Hide whitespace changes
Inline
Side-by-side
artifacts.php
View file @
46d6f644
...
...
@@ -169,16 +169,16 @@ function step($conn, $artifactid, $from, $to, $guard, $actions)
$conn
->
query
(
"update Artifact set node=
$to
where ID=
$artifactid
"
);
foreach
(
$actions
as
$action
)
{
debug
(
"executing
$action
"
);
try
{
//
try {
$action
=
str_replace
(
"CURRENT_ARTIFACT"
,
$artifactid
,
$action
);
if
(
$action
==
"PIGNISTIC"
)
pignistic
(
$conn
,
$artifactid
);
else
$conn
->
query
(
$action
);
}
catch
(
PDOException
$e
)
{
echo
"<p>Headache ! <pre>
$e
</pre></p>"
;
exit
;
}
//
} catch (PDOException $e) {
//
echo "<p>Headache ! <pre>$e</pre></p>";
//
exit;
//
}
}
}
...
...
credit.html
View file @
46d6f644
...
...
@@ -26,11 +26,13 @@
<h2>
Powered by
</h2>
<ul
class=
'creditlist'
>
<li>
First-order logic
<li>
Business
artifacts
<li>
Tuple
artifacts
<li>
Bootstrap
<li>
Apache
<li>
PHP
<li>
MySQL
<li>
Python
<li>
Java
<li>
Javascript
</li>
<li>
Cytoscape.js
</li>
</ul>
index.php
View file @
46d6f644
...
...
@@ -12,7 +12,6 @@
* MAIN: the main part of the Web page
*/
require
(
"HWlib.php"
);
require
(
"HTML.php"
);
require
(
"profile.php"
);
...
...
@@ -24,9 +23,10 @@ require("show-pages.php");
require
(
"artifacts.php"
);
require
(
"show-artifact.php"
);
session_start
();
try
{
// grobal exception catcher
@
debug
(
"Session id: "
.
$_SESSION
[
'id'
]);
@
debug
(
"GET parameter: project "
.
$_GET
[
'project'
]);
@
debug
(
"Session project: "
.
$_SESSION
[
'project'
]);
...
...
@@ -202,3 +202,23 @@ if (isset($_SESSION['username'])) {
require
(
"template-main.php"
);
}
catch
(
Exception
$e
){
// global exception handler
$message
=
$e
->
getMessage
();
$trace
=
$e
->
getTraceAsString
();
echo
"
<div class='alert alert-danger' role='alert'>
<h1>Headache !</h1>
<p>Sorry, we got an internal error. We are on it.</p>
<h2>Details</h2>
<p>
$message
</p>
<code>"
;
print_r
(
$e
->
getTrace
());
echo
"
</code>
</div>"
;
exit
;
}
?>
Write
Preview
Supports
Markdown
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