Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Show environment error message in aml (#2724)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkSnail authored Jul 27, 2020
1 parent eb9b72a commit 2d44d6d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/nni_manager/training_service/reusable/aml/amlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class AMLClient {
// received a message sent from the Python script (a simple "print" statement)
deferred.resolve(envId);
});
this.monitorError(this.pythonShellClient, deferred);
return deferred.promise;
}

Expand All @@ -81,6 +82,7 @@ export class AMLClient {
}
deferred.resolve(trackingUrl);
});
this.monitorError(this.pythonShellClient, deferred);
return deferred.promise;
}

Expand All @@ -98,6 +100,7 @@ export class AMLClient {
}
deferred.resolve(newStatus);
});
this.monitorError(this.pythonShellClient, deferred);
return deferred.promise;
}

Expand All @@ -120,6 +123,17 @@ export class AMLClient {
deferred.resolve(JSON.parse(command.slice(8)))
}
});
this.monitorError(this.pythonShellClient, deferred);
return deferred.promise;
}

// Monitor error information in aml python shell client
private monitorError(pythonShellClient: PythonShell, deferred: Deferred<any>): void {
pythonShellClient.on('error', function (error: any) {
deferred.reject(error);
});
pythonShellClient.on('close', function (error: any) {
deferred.reject(error);
});
}
}

0 comments on commit 2d44d6d

Please sign in to comment.