reportError method

Future<void> reportError(
  1. dynamic error,
  2. StackTrace stackTrace
)

Reports an error to the benchmark server.

The server will halt the devicelab task and log the error.

Implementation

Future<void> reportError(dynamic error, StackTrace stackTrace) async {
  _checkNotManualMode();
  await HttpRequest.request(
    '/on-error',
    method: 'POST',
    mimeType: 'application/json',
    sendData: json.encode(<String, dynamic>{
      'error': '$error',
      'stackTrace': '$stackTrace',
    }),
  );
}