Condense error handler in getServerStatus function.