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
7b27b7fe
authored
2013-12-17 08:53:15 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
change SopRun to a variable
1 parent
3a996c13
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
controller.go
router.go
controller.go
View file @
7b27b7f
...
...
@@ -24,6 +24,10 @@ import (
"github.com/astaxie/beego/session"
)
var
(
USERSTOPRUN
=
errors
.
New
(
"User stop run"
)
)
type
Controller
struct
{
Ctx
*
context
.
Context
Data
map
[
interface
{}]
interface
{}
...
...
@@ -181,7 +185,7 @@ func (c *Controller) Abort(code string) {
}
func
(
c
*
Controller
)
StopRun
()
{
panic
(
"StopRun"
)
panic
(
USERSTOPRUN
)
}
func
(
c
*
Controller
)
UrlFor
(
endpoint
string
,
values
...
string
)
string
{
...
...
router.go
View file @
7b27b7f
...
...
@@ -369,7 +369,7 @@ 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"
{
if
err
==
USERSTOPRUN
{
return
}
if
_
,
ok
:=
err
.
(
middleware
.
HTTPException
);
ok
{
...
...
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