abstract-sdk icon indicating copy to clipboard operation
abstract-sdk copied to clipboard

Split running into timeouts away from FileExportError

Open mowies opened this issue 5 years ago • 0 comments

I am currently implementing a small backup script using the Abstract SDK. The script just takes the master branch from all projects in my organization and puts them in a folder.

Since there's quite big files inside some projects, it seems that I often run into download timeouts. I found this issue only by going through the SDK code myself, because the error that was returned was a FileExportError which was very confusing.

After looking though the SDK code here [1], that error is thrown either when the file download progress status is failed or the download runs into the time limit that is set up in the Files endpoint implementation [2].

I would suggest to make this behaviour a little more clear by introducing a new TimeoutError and splitting this else if block and throwing separate errors.

[1] https://github.com/goabstract/abstract-sdk/blob/master/src/endpoints/Files.js#L138-L139 [2] https://github.com/goabstract/abstract-sdk/blob/master/src/endpoints/Files.js#L15

mowies avatar Oct 05 '20 07:10 mowies