Skip to content

Commit

Permalink
refactor: Use Label enum for error message
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-cucu committed Jan 18, 2024
1 parent 7c546d1 commit dffd015
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/store/app/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import type { RootState } from "store/store";

import type { ControllerArgs } from "./actions";

enum Label {
CONNECT_AND_START_POLLING_ERROR = "Error while triggering the connection and polling of models.",
}

export const logOut = createAsyncThunk<
void,
void,
Expand Down Expand Up @@ -81,13 +85,10 @@ export const connectAndStartPolling = createAsyncThunk<
// XXX Send to sentry if it's an error that's not connection related
// a common error logged to the console by this is:
// Error while triggering the connection and polling of models. cannot send request {"type":"ModelManager","request":"ListModels","version":5,"params":...}: connection state 3 is not open
console.error(
"Error while triggering the connection and polling of models.",
error,
);
console.error(Label.CONNECT_AND_START_POLLING_ERROR, error);
thunkAPI.dispatch(

Check warning on line 89 in src/store/app/thunks.ts

View check run for this annotation

Codecov / codecov/patch

src/store/app/thunks.ts#L88-L89

Added lines #L88 - L89 were not covered by tests
generalActions.storeConnectionError(
"Error while triggering the connection and polling of models.",
Label.CONNECT_AND_START_POLLING_ERROR,
),
);
}
Expand Down

0 comments on commit dffd015

Please sign in to comment.