A conditional inside function return false then throw custom json message
Hi,

Straight to the point, how can I custom error message in json ?

In laravel simply 

```
$query = //some query here

if ($query->status== false) {
 return response()->json(['status' => 'error', 'message' => 'your data is false']);
}

return response()->json(['status' => 'success', 'message' => $query]);
```
It will return **your data is false** response if query match with conditional. And will show the $query if query doesnt match with conditional.

When I try in Koa,

```
async invoiceHistory(ctx) {

const  query = await //some query here

if (query.status == false) {
 ctx.body = { status: "error", message: 'your data is false'} //and also how to custom code 500,400,404 etc.
}

ctx.body = {status: "success", message: query}

}
```
It will both return **status = success** response if query match with conditional. Its like koa is reading only the last ctx.body.

Any help will appreciate, thanks.