Skip to content

Commit

Permalink
Clear flash errors in case error action called directly
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Apr 23, 2011
1 parent 3c3fe4c commit aa18e23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rundeckapp/grails-app/controllers/ApiController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ class ApiController {
return render(contentType:"text/xml",encoding:"UTF-8"){
result(error:"true", apiversion:ApiRequestFilters.API_CURRENT_VERSION){
delegate.'error'{
if (!flash.error && !flash.errors && !request.error && !request.errors) {
message(g.message(code: "api.error.unknown"))
}
if(flash.error){
message(flash.error)
flash.error=null
}
if(request.error){
message(request.error)
Expand All @@ -59,15 +63,13 @@ class ApiController {
flash.errors.each{
message(it)
}
flash.errors = null
}
if(request.errors){
request.errors.each{
message(it)
}
}
if(!flash.error && !flash.errors && !request.error && !request.errors){
message(g.message(code:"api.error.unknown"))
}
}
}
}
Expand Down

0 comments on commit aa18e23

Please sign in to comment.