Files
flipper/xplat/Sonar/SonarStep.cpp
John Knox 38391ca29e Allow steps to fail with error message
Summary:
Add a method to add error messages into failed steps. This will be surfaced in the diagnostic screen, to help the user
troubleshoot.

Reviewed By: passy

Differential Revision: D9333322

fbshipit-source-id: 5f1e55c3d71b19292dbc428aaecfbd41e7a75125
2018-08-15 06:12:30 -07:00

31 lines
576 B
C++

/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#include "SonarStep.h"
#include "SonarState.h"
void SonarStep::complete() {
isLogged = true;
state->success(name);
}
void SonarStep::fail(std::string message) {
isLogged = true;
state->failed(name, message);
}
SonarStep::SonarStep(std::string step, SonarState* s) {
state = s;
name = step;
}
SonarStep::~SonarStep() {
if (!isLogged) {
state->failed(name, "");
}
}