diff --git a/pkg/errtypes/errtypes.go b/pkg/errtypes/errtypes.go index 14d18f744c5..e44d2819bf9 100644 --- a/pkg/errtypes/errtypes.go +++ b/pkg/errtypes/errtypes.go @@ -145,6 +145,16 @@ func (e InsufficientStorage) Error() string { return "error: insufficient storag // IsInsufficientStorage implements the IsInsufficientStorage interface. func (e InsufficientStorage) IsInsufficientStorage() {} +// This implementation is neede to allow TUS to cast the correct http errors +func (e InsufficientStorage) StatusCode() int { + return StatusInssufficientStorage +} + +// This implementation is neede to allow TUS to cast the correct http errors +func (e InsufficientStorage) Body() []byte { + return []byte(e.Error()) +} + // StatusInssufficientStorage 507 is an official http status code to indicate that there is insufficient storage // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507 const StatusInssufficientStorage = 507