Makes RuntimeError based on error code