Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
58638216
Commit
58638216
authored
Nov 15, 2011
by
Phill Sparks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Throw better Exceptions
parent
d643ec97
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
53 additions
and
53 deletions
+53
-53
asset.php
laravel/asset.php
+3
-3
manager.php
laravel/cache/manager.php
+1
-1
cookie.php
laravel/cookie.php
+2
-2
crypter.php
laravel/crypter.php
+3
-3
sqlite.php
laravel/database/connectors/sqlite.php
+2
-2
hydrator.php
laravel/database/eloquent/hydrator.php
+2
-2
manager.php
laravel/database/manager.php
+3
-3
query.php
laravel/database/query.php
+2
-2
html.php
laravel/html.php
+2
-2
input.php
laravel/input.php
+1
-1
ioc.php
laravel/ioc.php
+2
-2
lang.php
laravel/lang.php
+2
-2
memcached.php
laravel/memcached.php
+2
-2
redirect.php
laravel/redirect.php
+2
-2
redis.php
laravel/redis.php
+5
-5
controller.php
laravel/routing/controller.php
+2
-2
route.php
laravel/routing/route.php
+3
-3
factory.php
laravel/session/drivers/factory.php
+2
-2
payload.php
laravel/session/payload.php
+2
-2
str.php
laravel/str.php
+2
-2
url.php
laravel/url.php
+3
-3
validator.php
laravel/validator.php
+2
-2
view.php
laravel/view.php
+3
-3
No files found.
laravel/asset.php
View file @
58638216
...
...
@@ -303,11 +303,11 @@ class Asset_Container {
if
(
$dependency
===
$asset
)
{
throw
new
\Exception
(
"Asset [
$asset
] is dependent on itself."
);
throw
new
\
Logic
Exception
(
"Asset [
$asset
] is dependent on itself."
);
}
elseif
(
isset
(
$assets
[
$dependency
])
and
in_array
(
$asset
,
$assets
[
$dependency
][
'dependencies'
]))
{
throw
new
\Exception
(
"Assets [
$asset
] and [
$dependency
] have a circular dependency."
);
throw
new
\
Logic
Exception
(
"Assets [
$asset
] and [
$dependency
] have a circular dependency."
);
}
}
...
...
laravel/cache/manager.php
View file @
58638216
...
...
@@ -65,7 +65,7 @@ class Manager {
return
new
Drivers\Redis
(
Redis
::
db
());
default
:
throw
new
\Exception
(
"Cache driver
{
$driver
}
is not supported."
);
throw
new
\
Domain
Exception
(
"Cache driver
{
$driver
}
is not supported."
);
}
}
...
...
laravel/cookie.php
View file @
58638216
...
...
@@ -2,7 +2,7 @@
if
(
trim
(
Config
::
$items
[
'application'
][
'key'
])
===
''
)
{
throw
new
\Exception
(
'The cookie class may not be used without an application key.'
);
throw
new
\
Logic
Exception
(
'The cookie class may not be used without an application key.'
);
}
class
Cookie
{
...
...
laravel/crypter.php
View file @
58638216
...
...
@@ -2,7 +2,7 @@
if
(
trim
(
Config
::
$items
[
'application'
][
'key'
])
===
''
)
{
throw
new
\Exception
(
'The encryption class may not be used without an application key.'
);
throw
new
\
Logic
Exception
(
'The encryption class may not be used without an application key.'
);
}
class
Crypter
{
...
...
@@ -62,7 +62,7 @@ class Crypter {
{
if
((
$value
=
base64_decode
(
$value
))
===
false
)
{
throw
new
\Exception
(
'Decryption error. Input value is not valid base64 data.'
);
throw
new
\
InvalidArgument
Exception
(
'Decryption error. Input value is not valid base64 data.'
);
}
$iv
=
substr
(
$value
,
0
,
static
::
iv_size
());
...
...
laravel/database/connectors/sqlite.php
View file @
58638216
...
...
@@ -52,7 +52,7 @@ class SQLite extends Connector {
return
new
PDO
(
'sqlite:'
.
$config
[
'database'
],
null
,
null
,
$options
);
}
throw
new
\Exception
(
"SQLite database [
{
$config
[
'database'
]
}
] could not be found."
);
throw
new
\
OutOfBounds
Exception
(
"SQLite database [
{
$config
[
'database'
]
}
] could not be found."
);
}
}
laravel/database/eloquent/hydrator.php
View file @
58638216
...
...
@@ -18,7 +18,7 @@ class Hydrator {
{
if
(
!
method_exists
(
$eloquent
,
$include
))
{
throw
new
\Exception
(
"Attempting to eager load [
$include
], but the relationship is not defined."
);
throw
new
\
Logic
Exception
(
"Attempting to eager load [
$include
], but the relationship is not defined."
);
}
static
::
eagerly
(
$eloquent
,
$results
,
$include
);
...
...
laravel/database/manager.php
View file @
58638216
...
...
@@ -38,7 +38,7 @@ class Manager {
if
(
is_null
(
$config
))
{
throw
new
\Exception
(
"Database connection is not defined for connection [
$connection
]."
);
throw
new
\
OutOfBounds
Exception
(
"Database connection is not defined for connection [
$connection
]."
);
}
static
::
$connections
[
$connection
]
=
new
Connection
(
static
::
connect
(
$config
),
$config
);
...
...
@@ -88,7 +88,7 @@ class Manager {
return
new
Connectors\Postgres
;
default
:
throw
new
\Exception
(
"Database driver [
$driver
] is not supported."
);
throw
new
\
Domain
Exception
(
"Database driver [
$driver
] is not supported."
);
}
}
...
...
laravel/database/query.php
View file @
58638216
...
...
@@ -669,7 +669,7 @@ class Query {
}
}
throw
new
\Exception
(
"Method [
$method
] is not defined on the Query class."
);
throw
new
\
BadMethodCall
Exception
(
"Method [
$method
] is not defined on the Query class."
);
}
}
laravel/html.php
View file @
58638216
...
...
@@ -376,7 +376,7 @@ class HTML {
return
forward_static_call_array
(
'HTML::link_to_route'
,
$parameters
);
}
throw
new
\Exception
(
"Method [
$method
] is not defined on the HTML class."
);
throw
new
\
BadMethodCall
Exception
(
"Method [
$method
] is not defined on the HTML class."
);
}
}
laravel/input.php
View file @
58638216
...
...
@@ -123,7 +123,7 @@ class Input {
{
if
(
Config
::
get
(
'session.driver'
)
==
''
)
{
throw
new
\Exception
(
'A session driver must be specified in order to access old input.'
);
throw
new
\
UnexpectedValue
Exception
(
'A session driver must be specified in order to access old input.'
);
}
$old
=
IoC
::
core
(
'session'
)
->
get
(
Input
::
old_input
,
array
());
...
...
laravel/ioc.php
View file @
58638216
...
...
@@ -145,7 +145,7 @@ class IoC {
if
(
!
static
::
registered
(
$name
))
{
throw
new
\Exception
(
"Error resolving [
$name
]. No resolver has been registered in the container."
);
throw
new
\
OutOfBounds
Exception
(
"Error resolving [
$name
]. No resolver has been registered in the container."
);
}
$object
=
call_user_func
(
static
::
$registry
[
$name
][
'resolver'
],
$parameters
);
...
...
laravel/lang.php
View file @
58638216
...
...
@@ -149,7 +149,7 @@ class Lang {
return
array
(
$segments
[
0
],
implode
(
'.'
,
array_slice
(
$segments
,
1
)));
}
throw
new
\Exception
(
"Invalid language line [
$key
]. A specific line must be specified."
);
throw
new
\
InvalidArgument
Exception
(
"Invalid language line [
$key
]. A specific line must be specified."
);
}
/**
...
...
laravel/memcached.php
View file @
58638216
...
...
@@ -53,7 +53,7 @@ class Memcached {
if
(
$memcache
->
getVersion
()
===
false
)
{
throw
new
\Exception
(
'Could not establish memcached connection. Please verify your configuration.'
);
throw
new
\
Runtime
Exception
(
'Could not establish memcached connection. Please verify your configuration.'
);
}
return
$memcache
;
...
...
laravel/redirect.php
View file @
58638216
...
...
@@ -56,7 +56,7 @@ class Redirect extends Response {
{
if
(
Config
::
get
(
'session.driver'
)
==
''
)
{
throw
new
\Exception
(
'A session driver must be set before setting flash data.'
);
throw
new
\
Logic
Exception
(
'A session driver must be set before setting flash data.'
);
}
IoC
::
core
(
'session'
)
->
flash
(
$key
,
$value
);
...
...
@@ -91,7 +91,7 @@ class Redirect extends Response {
return
static
::
to
(
URL
::
to_route
(
substr
(
$method
,
3
),
$parameters
),
$status
);
}
throw
new
\Exception
(
"Method [
$method
] is not defined on the Redirect class."
);
throw
new
\
BadMethodCall
Exception
(
"Method [
$method
] is not defined on the Redirect class."
);
}
}
laravel/redis.php
View file @
58638216
...
...
@@ -65,7 +65,7 @@ class Redis {
{
if
(
is_null
(
$config
=
Config
::
get
(
"database.redis.
{
$name
}
"
)))
{
throw
new
\Exception
(
"Redis database [
$name
] is not defined."
);
throw
new
\
Domain
Exception
(
"Redis database [
$name
] is not defined."
);
}
static
::
$databases
[
$name
]
=
new
static
(
$config
[
'host'
],
$config
[
'port'
]);
...
...
@@ -98,7 +98,7 @@ class Redis {
switch
(
substr
(
$ersponse
,
0
,
1
))
{
case
'-'
:
throw
new
\Exception
(
'Redis error: '
.
substr
(
trim
(
$ersponse
),
4
));
throw
new
\
Runtime
Exception
(
'Redis error: '
.
substr
(
trim
(
$ersponse
),
4
));
case
'+'
:
case
':'
:
...
...
@@ -111,7 +111,7 @@ class Redis {
return
$this
->
multibulk
(
$ersponse
);
default
:
throw
new
\Exception
(
"Unknown response from Redis server: "
.
substr
(
$ersponse
,
0
,
1
));
throw
new
\
UnexpectedValue
Exception
(
"Unknown response from Redis server: "
.
substr
(
$ersponse
,
0
,
1
));
}
}
...
...
@@ -128,7 +128,7 @@ class Redis {
if
(
$this
->
connection
===
false
)
{
throw
new
\Exception
(
"Error making Redis connection:
{
$error
}
-
{
$message
}
"
);
throw
new
\
Runtime
Exception
(
"Error making Redis connection:
{
$error
}
-
{
$message
}
"
);
}
return
$this
->
connection
;
...
...
laravel/routing/controller.php
View file @
58638216
...
...
@@ -39,7 +39,7 @@ abstract class Controller {
{
if
(
strpos
(
$destination
,
'@'
)
===
false
)
{
throw
new
\Exception
(
"Route delegate [
{
$destination
}
] has an invalid format."
);
throw
new
\
InvalidArgument
Exception
(
"Route delegate [
{
$destination
}
] has an invalid format."
);
}
list
(
$controller
,
$method
)
=
explode
(
'@'
,
$destination
);
...
...
@@ -226,7 +226,7 @@ abstract class Controller {
return
IoC
::
resolve
(
$key
);
}
throw
new
\Exception
(
"Attempting to access undefined property [
$key
] on controller."
);
throw
new
\
OutOfBounds
Exception
(
"Attempting to access undefined property [
$key
] on controller."
);
}
}
laravel/routing/route.php
View file @
58638216
...
...
@@ -63,7 +63,7 @@ class Route {
if
(
!
$callback
instanceof
Closure
and
!
is_array
(
$callback
)
and
!
is_string
(
$callback
))
{
throw
new
\Exception
(
'Invalid route defined for URI ['
.
$this
->
key
.
']'
);
throw
new
\
InvalidArgument
Exception
(
'Invalid route defined for URI ['
.
$this
->
key
.
']'
);
}
}
...
...
@@ -226,7 +226,7 @@ class Route {
return
$this
->
is
(
substr
(
$method
,
3
));
}
throw
new
\Exception
(
"Call to undefined method [
$method
] on Route class."
);
throw
new
\
BadMethodCall
Exception
(
"Call to undefined method [
$method
] on Route class."
);
}
}
laravel/session/drivers/factory.php
View file @
58638216
...
...
@@ -33,7 +33,7 @@ class Factory {
return
new
Redis
(
Cache
::
driver
(
'redis'
));
default
:
throw
new
\Exception
(
"Session driver [
$driver
] is not supported."
);
throw
new
\
Domain
Exception
(
"Session driver [
$driver
] is not supported."
);
}
}
...
...
laravel/session/payload.php
View file @
58638216
...
...
@@ -10,7 +10,7 @@ use Laravel\Session\Drivers\Sweeper;
if
(
Config
::
$items
[
'application'
][
'key'
]
===
''
)
{
throw
new
\Exception
(
"An application key is required to use sessions."
);
throw
new
\
Logic
Exception
(
"An application key is required to use sessions."
);
}
class
Payload
{
...
...
laravel/str.php
View file @
58638216
...
...
@@ -196,7 +196,7 @@ class Str {
return
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
default
:
throw
new
\Exception
(
"Invalid random string type [
$type
]."
);
throw
new
\
Domain
Exception
(
"Invalid random string type [
$type
]."
);
}
}
...
...
laravel/url.php
View file @
58638216
...
...
@@ -115,7 +115,7 @@ class URL {
return
static
::
to
(
str_replace
(
array
(
'/(:any?)'
,
'/(:num?)'
),
''
,
$uri
),
$https
);
}
throw
new
\Exception
(
"Error generating named route for route [
$name
]. Route is not defined."
);
throw
new
\
OutOfBounds
Exception
(
"Error generating named route for route [
$name
]. Route is not defined."
);
}
/**
...
...
@@ -186,7 +186,7 @@ class URL {
return
static
::
to_route
(
substr
(
$method
,
3
),
$parameters
);
}
throw
new
\Exception
(
"Method [
$method
] is not defined on the URL class."
);
throw
new
\
BadMethodCall
Exception
(
"Method [
$method
] is not defined on the URL class."
);
}
}
laravel/validator.php
View file @
58638216
...
...
@@ -683,7 +683,7 @@ class Validator {
return
call_user_func_array
(
static
::
$validators
[
$method
],
$parameters
);
}
throw
new
\Exception
(
"Call to undefined method [
$method
] on Validator instance."
);
throw
new
\
BadMethodCall
Exception
(
"Call to undefined method [
$method
] on Validator instance."
);
}
}
laravel/view.php
View file @
58638216
...
...
@@ -87,7 +87,7 @@ class View {
}
}
throw
new
\Exception
(
"View [
$view
] does not exist."
);
throw
new
\
Runtime
Exception
(
"View [
$view
] does not exist."
);
}
/**
...
...
@@ -138,7 +138,7 @@ class View {
return
static
::
make
(
$view
,
$data
);
}
throw
new
\Exception
(
"Named view [
$name
] is not defined."
);
throw
new
\
OutOfBounds
Exception
(
"Named view [
$name
] is not defined."
);
}
/**
...
...
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