Skip to content

Commit

Permalink
fix error pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Mar 6, 2024
1 parent a18b00a commit e32cc03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/www/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,21 +599,11 @@ export class App {
connectionState: ServerConnectionState.DISCONNECTED,
};

if (server.sessionConfig?.extra) {
const extraParams = server.sessionConfig.extra;

if (['error', 'warning', 'info'].includes(extraParams.messageType) && extraParams.messageContent) {
serverListItem.message = {
type: extraParams.messageType as 'error' | 'warning' | 'info',
content: extraParams.messageContent,
};
}

if (extraParams.contactEmail) {
serverListItem.contact = {
email: extraParams.email,
};
}
if (server.error) {
serverListItem.message = {
type: 'error',
content: server.error,
};
}

return serverListItem;
Expand Down
3 changes: 3 additions & 0 deletions src/www/model/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export interface Server {
// The name of this server, as given by the user.
name: string;

// Error returned pertaining to the server's status
error: string;

// The location to pull the session config from on each connection.
sessionConfigLocation?: URL;

Expand Down

0 comments on commit e32cc03

Please sign in to comment.