Skip to content

HTTP status management #188

Description

@pyrollo

We do not handle HTTP status codes correctly (relying on URL class or status ranges depending on where we do that).

We should probabely develop a specific DataFetcher able to perform HTTP requests, file access, and maybe more, and have two possible behavior:

  • Throw an exception corresponding to the situation (definitively not OK, or retryable);
  • Returns data (likely as InputStream).

On HTTP point of view, this DataFetcher could perform actions according to HTTP status.

Actions

Proceed

No exception thrown, content available for processing.

Fail

No chance a retry would help. Throws a GeneationFailedException.

Retry

Situation could evolve. Throws a RetryableExeception.

Follow

For these statuses a "follow" mechanisme could be developped to follow given link. For now throws a GeneationFailedException.

Statuses

Code Description Action Commment
100 Continue Fail Won't implement
101 Switching Protocols Fail Won't implement
102 Processing Fail Shouldn't occur
103 Early Hints Fail Won't implement
200 OK Proceed
201 Created Proceed
202 Accepted Proceed
203 Non-Authoritative Information Proceed
204 No Content Proceed
205 Reset Content Fail Shouldn't occur
206 Partial Content Fail Maybe future
207 Multi-Status Fail WebDav only
208 Already Reported Fail WebDav only
226 IM Used Fail Won't implement
300 Multiple Choices Follow
301 Moved Permanently Follow
302 Found Proceed
303 See Other Follow Not sure
304 Not Modified Proceed
307 Temporary Redirect Follow
308 Permanent Redirect Follow
400 Bad Request Fail
401 Unauthorized Fail
402 Payment Required Fail
403 Forbidden Fail
404 Not Found Fail
405 Method Not Allowed Fail
406 Not Acceptable Fail
407 Proxy Authentication Required Fail
408 Request Timeout Retry
409 Conflict Retry Shouldn't occur
410 Gone Fail
411 Length Required Fail
412 Precondition Failed Fail
413 Content Too Large Fail
414 URI Too Long Fail
415 Unsupported Media Type Fail
416 Range Not Satisfiable Fail
417 Expectation Failed Fail
418 I'm a teapot Fail
421 Misdirected Request Fail
422 Unprocessable Content Fail
423 Locked Fail WebDav only
424 Failed Dependency Fail
425 Too Early Fail Maybe later :p
426 Upgrade Required Fail
428 Precondition Required Fail
429 Too Many Requests Retry
431 Request Header Fields Too Large Fail
451 Unavailable For Legal Reasons Fail
500 Internal Server Error Retry
501 Not Implemented Fail
502 Bad Gateway Retry
503 Service Unavailable Retry
504 Gateway Timeout Retry
505 HTTP Version Not Supported Fail
506 Variant Also Negotiates Fail Won't implement
507 Insufficient Storage Retry
508 Loop Detected Fail
510 Not Extended Fail
511 Network Authentication Required Fail

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions