code: func ErrorAuto(w http.ResponseWriter, err error) {
  	if types.IsBadRequest(err) {
  		ErrorString(w, http.StatusBadRequest, types.CodeInvalidParameter, err)
  		return
  	}
  
  	if storage.IsWriteConflictError(err) {
  		ErrorString(w, http.StatusNotFound, types.CodeResourceConflict, err)
  		return
  	}
  
  	if topdown.IsError(err) {
  		Error(w, http.StatusInternalServerError, types.NewErrorV1(types.CodeInternal, types.MsgEvaluationError).WithError(err))
  		return
  	}
  
  	if storage.IsInvalidPatch(err) {
  		ErrorString(w, http.StatusBadRequest, types.CodeInvalidParameter, err)
  		return
  	}
  
  	if storage.IsNotFound(err) {
  		ErrorString(w, http.StatusNotFound, types.CodeResourceNotFound, err)
  		return
  	}
  
  	ErrorString(w, http.StatusInternalServerError, types.CodeInternal, err)
  }
docs: // ErrorAuto writes a response with status and code set automatically based on
  // the type of err.