Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: Correctly handle abort error
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge authored and backportbot[bot] committed Apr 9, 2025
commit 2c0b9657330113d827f553358455750193ee24f5
2 changes: 1 addition & 1 deletion src/mixins/FetchFilesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
logger.error('Fail to create source directory', { error })
}
}
} else if (error.code === 'ERR_CANCELED') {
} else if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
} else {
this.errorFetchingFiles = error
Expand Down
6 changes: 3 additions & 3 deletions src/services/Albums.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function fetchAlbum(path, options, extraProps = '', client = defaul

return formatAlbum(response.data)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return null
}

Expand Down Expand Up @@ -93,7 +93,7 @@ export async function fetchAlbums(path, options, extraProps = '', client = defau
.filter(album => album.filename !== path)
.map(formatAlbum)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down Expand Up @@ -163,7 +163,7 @@ export async function fetchAlbumContent(path, options, client = defaultClient) {

return fetchedFiles
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down
6 changes: 3 additions & 3 deletions src/services/collectionFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function fetchCollection(path, options, extraProps = [], client = d

return formatCollection(response.data)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return null
}

Expand Down Expand Up @@ -129,7 +129,7 @@ export async function fetchCollections(path, options, extraProps = [], client =
.filter(collection => collection.filename !== path)
.map(formatCollection)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down Expand Up @@ -200,7 +200,7 @@ export async function fetchCollectionFiles(path, options, extraProps = [], clien

return fetchedFiles
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down