Handle exception

@lxyu