mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix error handling when store unreachable (#1925)
Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
This commit is contained in:
@@ -55,8 +55,8 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
mergeMap(([prev, curr]) => from(Object.entries(getNewEntries(prev, curr)))),
|
||||
mergeMap(([url, registry]) =>
|
||||
this.fetchStore$(url).pipe(
|
||||
map<StoreData, [string, StoreData | null]>(data => {
|
||||
if (data.info) this.updateStoreIdentifier(url, registry, data.info)
|
||||
map<StoreData | null, [string, StoreData | null]>(data => {
|
||||
if (data?.info) this.updateStoreIdentifier(url, registry, data.info)
|
||||
|
||||
return [url, data]
|
||||
}),
|
||||
@@ -156,12 +156,13 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
)
|
||||
}
|
||||
|
||||
private fetchStore$(url: string): Observable<StoreData> {
|
||||
private fetchStore$(url: string): Observable<StoreData | null> {
|
||||
return combineLatest([this.fetchInfo$(url), this.fetchPackages$(url)]).pipe(
|
||||
map(([info, packages]) => ({ info, packages })),
|
||||
catchError(e => {
|
||||
console.error(e)
|
||||
this.requestErrors$.next(this.requestErrors$.value.concat(url))
|
||||
return of(e)
|
||||
return of(null)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user