abstract-sdk
abstract-sdk copied to clipboard
Split running into timeouts away from FileExportError
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