class PostmanService {

    int toErrorLine(Failure failure) {
        if (Failure.AT_PRE_REQUEST_SCRIPT.equals(failure.getAt())) {
            return LINE_PRE_REQUEST_SCRIPT;
        }
        if (Failure.AT_TEST_SCRIPT.equals(failure.getAt())) {
            return LINE_TEST_SCRIPT;
        }
        return (failure.getError().getIndex() == null ? REQUEST_LINE : failure.getError().getIndex().intValue());
    }

}