Gautam
Gautam

Reputation: 7958

How to Manually throw error Pages in Play Framework?

How do I manually throw a 404 or 500 error in Play framework 1.2.x?

I am currently rendering the 404.html and 500.html templates using renderTemplate() method. But how do I do it the proper way ?

Upvotes: 2

Views: 5842

Answers (3)

Mark
Mark

Reputation: 2542

return internalServerError(filledForm.errorsAsJson());

Upvotes: 0

PiotrkS
PiotrkS

Reputation: 381

In your controller you can just invoke static error() method from Controller which will give 500 status.

Upvotes: 2

axtavt
axtavt

Reputation: 242686

Play Controller has error() and notFound() methods for this purpose.

Upvotes: 6

Related Questions