File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export class NaoRobotModel extends DOMWidgetModel {
83
83
this . qiSession = new QiSession ( ipAddress , port ) ;
84
84
85
85
// Timeout after ~10 seconds
86
- for ( let i = 0 ; i < 100 ; i ++ ) {
86
+ for ( let i = 0 ; i < 10 ; i ++ ) {
87
87
if ( this . qiSession . isConnected ( ) ) {
88
88
this . connected = 'Connected' ;
89
89
this . set ( 'connected' , 'Connected' ) ;
@@ -146,10 +146,18 @@ export class NaoRobotModel extends DOMWidgetModel {
146
146
147
147
const naoService = await servicePromise
148
148
. then ( ( resolution : any ) => {
149
+ this . send ( {
150
+ isError : false ,
151
+ data : resolution ?? true ,
152
+ } ) ;
149
153
return resolution ;
150
154
} )
151
155
. catch ( ( rejection : string ) => {
152
156
this . changeStatus ( rejection ) ;
157
+ this . send ( {
158
+ isError : true ,
159
+ data : rejection ,
160
+ } ) ;
153
161
return rejection ;
154
162
} ) ;
155
163
@@ -183,6 +191,11 @@ export class NaoRobotModel extends DOMWidgetModel {
183
191
await sleep ( 100 ) ;
184
192
}
185
193
194
+ if ( this . _services [ serviceName ] === undefined ) {
195
+ this . changeStatus ( serviceName + ' not available.' ) ;
196
+ return ;
197
+ }
198
+
186
199
if ( this . _services [ serviceName ] [ methodName ] === undefined ) {
187
200
this . changeStatus ( methodName + ' does not exist for ' + serviceName ) ;
188
201
return ;
You can’t perform that action at this time.
0 commit comments