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
20463fa7
authored
2014-08-13 17:26:22 +0800
by
smallfish
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add CustomAbort() for Controller, support status code and body
1 parent
289f050c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
controller.go
controller.go
View file @
20463fa
...
...
@@ -274,6 +274,11 @@ func (c *Controller) Abort(code string) {
}
}
// CustomAbort stops controller handler and show the error data, it's similar Aborts, but support status code and body.
func
(
c
*
Controller
)
CustomAbort
(
status
int
,
body
string
)
{
c
.
Ctx
.
Abort
(
status
,
body
)
}
// StopRun makes panic of USERSTOPRUN error and go to recover function if defined.
func
(
c
*
Controller
)
StopRun
()
{
panic
(
USERSTOPRUN
)
...
...
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