mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 11:25:31 +00:00
error handling for stream
This commit is contained in:
parent
5ddc028cc8
commit
4967c8e6c5
3 changed files with 22 additions and 8 deletions
|
@ -295,12 +295,18 @@ async function uploadFile(
|
|||
httpClient,
|
||||
resourceUrl,
|
||||
() =>
|
||||
fs.createReadStream(archivePath, {
|
||||
fd,
|
||||
start,
|
||||
end,
|
||||
autoClose: false
|
||||
}),
|
||||
fs
|
||||
.createReadStream(archivePath, {
|
||||
fd,
|
||||
start,
|
||||
end,
|
||||
autoClose: false
|
||||
})
|
||||
.on("error", error => {
|
||||
throw new Error(
|
||||
`Cache upload failed because file read failed with ${error.Message}`
|
||||
);
|
||||
}),
|
||||
start,
|
||||
end
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue