Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b9fdbdf7
authored
2013-12-16 23:22:15 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
use StopRun to terminate the execution
1 parent
436f9a74
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
controller.go
router.go
controller.go
View file @
b9fdbdf
...
...
@@ -181,7 +181,7 @@ func (c *Controller) Abort(code string) {
}
func
(
c
*
Controller
)
StopRun
()
{
panic
(
""
)
panic
(
"
StopRun
"
)
}
func
(
c
*
Controller
)
UrlFor
(
endpoint
string
,
values
...
string
)
string
{
...
...
router.go
View file @
b9fdbdf
...
...
@@ -369,6 +369,9 @@ func (p *ControllerRegistor) UrlFor(endpoint string, values ...string) string {
func
(
p
*
ControllerRegistor
)
ServeHTTP
(
rw
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
defer
func
()
{
if
err
:=
recover
();
err
!=
nil
{
if
fmt
.
Sprint
(
err
)
==
"StopRun"
{
return
}
if
_
,
ok
:=
err
.
(
middleware
.
HTTPException
);
ok
{
// catch intented errors, only for HTTP 4XX and 5XX
}
else
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment