Feature Request #3477

Remote Exception codes

Added by Michael R over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:12/13/2010
Priority:NormalDue date:
Assignee:Woody Gilk% Done:

0%

Category:Core
Target version:v3.0.10
Resolution:fixed Points:

Description

I have noticed that error codes are not set when an exception occurs. There are many cases where error codes are needed from a certain exception. For example, when using the remote class I would like to know what error code CURL gives me. If curl failed due to a bad request or a timeout. If its a bad request I will stop executing, if its a timeout I will retry my request etc.
My suggestion is to either add an error code to the exception thus extracting it via getCode() or change the format of the message text to an array that includes error codes, error types and messages.

array(
'error_code' => curl_errno($remote),
'error' => array(
'message' => curl_error($remote),
'type' => 'curl_exception'
)
)

Associated revisions

Revision cc6e0ed1
Added by Woody Gilk over 3 years ago

Add status code to the exception in Remote::get, fixes #3477

History

#1 Updated by Jeremy Bush over 3 years ago

  • Subject changed from Exception codes to Remote Exception codes
  • Target version set to v3.0.9

Unless you have other specific areas where exception codes need to be set, I'm going to rename this issue to "Remote error codes"

#2 Updated by Woody Gilk over 3 years ago

  • Status changed from New to Assigned

#3 Updated by Woody Gilk over 3 years ago

  • Target version changed from v3.0.9 to v3.0.10

#4 Updated by Woody Gilk over 3 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

#5 Updated by Michael R over 3 years ago

This update does not give me the CURL error code only the HTTP codes. It's interesting to know if the request e.g. timed out or if it was a bad request.

Also available in: Atom PDF