Skip to content

Commit 2b0a1b6

Browse files
authored
Update README.md
1 parent cb700b7 commit 2b0a1b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ Complete API documentation can be found here: [Gymie-Client API](https://jscript
7575
In the [previous section](#how-to-run-the-client-and-server) we already saw how to import gymie, connect to the server, instantiate an environment and call a few API methods. Let's go a bit more in detail with a complete example of a random agent interacting with an environment:
7676

7777
```ts
78-
import Gymie from 'gymie'
79-
import { Continuous, Discrete } from 'gymie/Env'
78+
import Gymie from '../dist'
79+
import { Continuous, Discrete } from '../dist/Env'
8080
import {
8181
ConnectFailed,
8282
NoConnected,
8383
ConnectionError,
8484
ConnectionClosed
85-
} from 'gymie/errors'
85+
} from '../dist/errors'
8686

8787
const wsApi = 'http://0.0.0.0:5000/gym'
8888
const envId = 'LunarLander-v2'
@@ -137,7 +137,7 @@ const { log } = console
137137

138138
} catch(err) {
139139
switch(true) {
140-
// This could happen when trying to connect to the server
140+
// This could happen while trying to connect to the server
141141
case err instanceof ConnectFailed: break
142142

143143
// There is no connection and we try to instantiate an environment
@@ -149,9 +149,9 @@ const { log } = console
149149
// Server closed the connection. Code and reason comes in the message
150150
case err instanceof ConnectionClosed: break
151151
}
152+
} finally {
153+
gymie.close()
152154
}
153-
154-
gymie.close()
155155
})()
156156
```
157157

0 commit comments

Comments
 (0)