feat: Add game activity status (Experimental)
All checks were successful
Queue Release Build / prepare (push) Successful in 23s
Deploy Web Apps / deploy (push) Successful in 5m54s
Queue Release Build / build-windows (push) Successful in 16m19s
Queue Release Build / build-linux (push) Successful in 30m13s
Queue Release Build / finalize (push) Successful in 47s
All checks were successful
Queue Release Build / prepare (push) Successful in 23s
Deploy Web Apps / deploy (push) Successful in 5m54s
Queue Release Build / build-windows (push) Successful in 16m19s
Queue Release Build / build-linux (push) Successful in 30m13s
Queue Release Build / finalize (push) Successful in 47s
This commit is contained in:
@@ -8,7 +8,11 @@ import {
|
||||
of,
|
||||
throwError
|
||||
} from 'rxjs';
|
||||
import { catchError, map, scan } from 'rxjs/operators';
|
||||
import {
|
||||
catchError,
|
||||
map,
|
||||
scan
|
||||
} from 'rxjs/operators';
|
||||
import {
|
||||
ChannelPermissionOverride,
|
||||
type Channel,
|
||||
@@ -32,6 +36,19 @@ import type {
|
||||
} from '../../domain/models/server-directory.model';
|
||||
import type { RoomSignalSourceInput } from '../../domain/logic/room-signal-source.logic';
|
||||
|
||||
interface ServerLookupError {
|
||||
status?: number;
|
||||
error?: {
|
||||
errorCode?: unknown;
|
||||
};
|
||||
}
|
||||
|
||||
function isServerNotFoundError(error: unknown): boolean {
|
||||
const lookupError = error as ServerLookupError;
|
||||
|
||||
return lookupError?.status === 404 && lookupError.error?.errorCode === 'SERVER_NOT_FOUND';
|
||||
}
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ServerDirectoryApiService {
|
||||
private readonly http = inject(HttpClient);
|
||||
@@ -90,6 +107,10 @@ export class ServerDirectoryApiService {
|
||||
return this.http.get<ServerInfo>(`${this.getApiBaseUrl(selector)}/servers/${serverId}`).pipe(
|
||||
map((server) => this.normalizeServerInfo(server, this.resolveEndpoint(selector))),
|
||||
catchError((error) => {
|
||||
if (isServerNotFoundError(error)) {
|
||||
return of(null);
|
||||
}
|
||||
|
||||
console.error('Failed to get server:', error);
|
||||
return of(null);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user