Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 6d4aed0

Browse files
authored
Merge pull request #118 from AssemblyAI/niels/update-close-codes-rt
Update the realtime close error code messages
2 parents ad9b2e9 + d0cd449 commit 6d4aed0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/assemblyai/api/RealtimeTranscriber.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void close() {
179179
}
180180

181181
private void closeSocket() {
182-
if(webSocket == null) return;
182+
if (webSocket == null) return;
183183
this.webSocket.close(1000, "Shutting down");
184184
this.webSocket.cancel();
185185
this.webSocket = null;
@@ -521,7 +521,8 @@ public Void visit(RealtimeError value) {
521521
private final HashMap<Integer, String> closeCodeErrorMessages = new HashMap<Integer, String>() {{
522522
put(4000, "Sample rate must be a positive integer");
523523
put(4001, "Not Authorized");
524-
put(4002, "Insufficient funds or you are using a free account. This feature is paid-only and requires you to add a credit card. Please visit https://assemblyai.com/dashboard/ to add a credit card to your account.");
524+
put(4002, "Insufficient Funds");
525+
put(4003, "This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account.");
525526
put(4004, "Session ID does not exist");
526527
put(4008, "Session has expired");
527528
put(4010, "Session is closed");
@@ -530,10 +531,10 @@ public Void visit(RealtimeError value) {
530531
put(4031, "Session Timeout");
531532
put(4032, "Audio too short");
532533
put(4033, "Audio too long");
533-
put(4100, "Bad JSON");
534+
put(4034, "Audio too small to transcode");
534535
put(4101, "Bad schema");
535536
put(4102, "Too many streams");
536537
put(4103, "Reconnected");
537-
put(1013, "Reconnect attempts exhausted");
538+
put(4104, "Could not parse word boost parameter");
538539
}};
539540
}

0 commit comments

Comments
 (0)