Skip to content

Commit

Permalink
#728 add send error and HttpStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
schoicsiro committed Oct 11, 2023
1 parent c12a994 commit 818b019
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package au.org.ala.profile.hub
import au.org.ala.profile.security.Role
import au.org.ala.profile.security.Secured
import au.org.ala.ws.service.WebService
import org.apache.http.HttpStatus
import org.apache.http.entity.ContentType

import javax.validation.constraints.NotNull
Expand Down Expand Up @@ -132,10 +133,11 @@ class AdminController extends BaseController {
grailsCacheManager.getCache(params.id).clear()
result.resp = "Successfully cleared cache - " + params.id
result.statusCode = HttpStatus.SC_OK
success result
} else {
result.error = "Failed to clear cache the job"
result.statusCode = HttpStatus.SC_INTERNAL_SERVER_ERROR
sendError result
}
success result
}
}

0 comments on commit 818b019

Please sign in to comment.