when handler error, return 500, Internal Error.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>