Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webbasics
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
Taddeüs Kroes
webbasics
Commits
d379120e
Commit
d379120e
authored
12 years ago
by
Taddeus Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Template class now uses FormattedException instead of RuntimeException
parent
b646dfc0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
template.php
+5
-5
5 additions, 5 deletions
template.php
tests/test_template.php
+1
-1
1 addition, 1 deletion
tests/test_template.php
with
6 additions
and
6 deletions
template.php
+
5
−
5
View file @
d379120e
...
...
@@ -158,9 +158,9 @@ class Template extends Node {
}
if
(
!
$found
)
{
throw
new
\Runtime
Exception
(
sprintf
(
"Could not find template file
\"
%s
\"
, looked in folders:
\n
%s"
,
$filename
,
implode
(
"
\n
"
,
$look_in
)
)
throw
new
Formatted
Exception
(
"Could not find template file
\"
%s
\"
, looked in folders:
\n
%s"
,
$filename
,
implode
(
"
\n
"
,
$look_in
)
);
}
...
...
@@ -455,7 +455,7 @@ class Template extends Node {
// <nested_exp>||<nested_exp>
try
{
return
self
::
evaluateExpression
(
substr
(
$expression
,
0
,
$split_at
),
$data
,
false
);
}
catch
(
\
Runtime
Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
self
::
evaluateExpression
(
substr
(
$expression
,
$split_at
+
2
),
$data
,
false
);
}
}
...
...
@@ -505,7 +505,7 @@ class Template extends Node {
*
* @package WebBasics
*/
class
ParseError
extends
\
Runtime
Exception
{
class
ParseError
extends
\Exception
{
/**
* Constructor.
*
...
...
This diff is collapsed.
Click to expand it.
tests/test_template.php
+
1
−
1
View file @
d379120e
...
...
@@ -92,7 +92,7 @@ class TemplateTest extends PHPUnit_Framework_TestCase {
}
/**
* @expectedException
Runtime
Exception
* @expectedException
webbasics\Formatted
Exception
*/
function
testNonExistingTemplate
()
{
$bar
=
new
Template
(
'bar'
);
...
...
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