Comments (7)
One thought: in the documentation, it should be written that the datastores are supposed to work with any client; a custom http status must be appropriately!
- 1xx: Continuing process
- 2xx: Processed successfully
- 3xx: Redirection (no reason to be used, I think)
- 4xx: Client error (no need for the client to retry "as-is")
- 5xx: Server error (a later retry may succeed)
from tusd.
I added a corresponding interface to address this issue. However, I am not entirely sure whether to keep the name, HTTPError. Will think about this a bit more :)
from tusd.
I do agree that this is a good idea. I will think a bit about how we can implement this is a proper way.
from tusd.
Maybe this could provide inspiration: https://elithrar.github.io/article/http-handler-error-handling-revisited/
from tusd.
@Acconut : any update on this?
The final implementation of https://elithrar.github.io/article/http-handler-error-handling-revisited/ allows to be fully backward compatible! (thanks to the switch e := err.(type)
)
from tusd.
I apologize for me belated response. Backwards-compatibility is not an issue I am concerned about but binding the data store implementations tightly to the HTTP protocol. Right now, the data stores have no knowledge that they are accessed using the HTTP protocol and keeping it like that has some advantages to separate the HTTP server accepting requests and the data store which takes care of handling the uploads. I haven't fully decided whether that's a big enough reason to prevent your feature request to be implemented or not but I will give it a try the next few days and then we will see.
from tusd.
I get your point about not only thinking about the http protocol.
Currently the specs only tells about http:
"The protocol provides a mechanism for resumable file uploads via HTTP/1.1 (RFC 7230) and HTTP/2 (RFC 7540)." https://tus.io/protocols/resumable-upload.html#abstract
And I think that if another protocol is supported at some point, it will also need a way to get some status about the transmission. Since the http status codes are well documented, they can be used as a basis to be translated to match the other protocol status codes.
Moreover I see no drawback into providing a custom error interface (StatusError{403, err}
for instance) to categorize the errors:
- if you need the categorization at a later point in time, it's already available
- if you don't need it, you can still consider them as regular error
from tusd.
Related Issues (20)
- pre-finish blocking script problem HOT 1
- validating video files using blocking hooks HOT 4
- Support for managed identity for Azure blob storage HOT 1
- AzureService is using a deprecated SDK (github.com/Azure/azure-storage-blob-go/azblob) HOT 1
- hooks: Hooks continue failing after plugin crashes
- Getting error about part sizes with Cloudflare R2 bucket HOT 3
- Up to date Golang client? HOT 3
- While passing s3Client to s3store.New getting an error named missing method AbortMultipartUploadWithContext HOT 2
- Return 4xx errors from Hooks as 4xx errors. HOT 3
- Best way to pass a server variable to the JS client HOT 3
- How to delete files uploaded to server? HOT 1
- Duplicate id printing in log HOT 1
- `InternalServerError: no such file or directory` when Downloading file with using File Locker. HOT 1
- Extract ID from Path is broken if base path is provided HOT 6
- s3store: unable to create multipart upload HOT 1
- Example haproxy config HOT 11
- Local storage - folder hierarchy HOT 4
- Checking current usage vs limit using /quota endpoint. HOT 3
- FileInfoChanges set in PreFinishHook not available in PostFinishHook HOT 2
- Is lockUpload really needed for HEAD? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tusd.