func RaiseError(w http.ResponseWriter, err error) {
  errorData := ErrorType[err.Error()]

  // raise a custom error if not found in the map
  if errorData.Code == 0 {
    RaiseCustomError(w, err.Error(), 500)
    return
  }

  // otherwise continue with the error output
  ErrorResponse(w, errorData)
}
// RaiseError responds with an ErrorData struct from the ErrorType
// map of string to ErrorData, based on the err message.
RaiseError responds with an ErrorData struct from the ErrorType
map of string to ErrorData, based on the err message.
// RaiseError responds with an ErrorData struct from the ErrorType // map of string to ErrorData based on the err message .
func RaiseError(w http.ResponseWriter, err error) {
  errorData := ErrorType[err.Error()]
  if errorData.Code == 0 {
    RaiseCustomError(w, err.Error(), 500)
    return
  }
  ErrorResponse(w, errorData)
}
func RaiseError ( w http . ResponseWriter , err error ) { errorData := ErrorType [ err . Error ( ) ] if errorData . Code == 0 { RaiseCustomError ( w , err . Error ( ) , 500 ) return } ErrorResponse ( w , errorData ) }
RaiseError responds with an ErrorData struct from the ErrorType
map of string to ErrorData, based on the err message.
RaiseError responds with an ErrorData struct from the ErrorType map of string to ErrorData based on the err message .
// raise a custom error if not found in the map // otherwise continue with the error output