modify registryhandler

i am not sure if registry fail,return a custom status code in header or http.error.