Skip to content

Commit

Permalink
fix(state-error): hide error info for "AssertViewError"
Browse files Browse the repository at this point in the history
  • Loading branch information
oldskytree committed Apr 22, 2022
1 parent 549d8f5 commit 0711226
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/static/components/state/state-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {isEmpty, map, isFunction} from 'lodash';
import ReactHtmlParser from 'react-html-parser';
import * as actions from '../../modules/actions';
import Screenshot from './screenshot';
import {isNoRefImageError} from '../../modules/utils';
import {isNoRefImageError, isAssertViewError} from '../../modules/utils';
import ErrorDetails from './error-details';
import Details from '../details';
import {ERROR_TITLE_TEXT_LENGTH} from '../../../constants/errors';
Expand Down Expand Up @@ -94,6 +94,10 @@ class StateError extends Component {
});
}

_shouldDrawErrorInfo(error) {
return !isAssertViewError(error);
}

render() {
const {error, errorDetails} = this.props;
const errorPattern = this._getErrorPattern();
Expand All @@ -104,7 +108,7 @@ class StateError extends Component {

return (
<div className="image-box__image image-box__image_single">
<div className="error">{this._errorToElements(extendedError)}</div>
{this._shouldDrawErrorInfo(extendedError) && <div className="error">{this._errorToElements(extendedError)}</div>}
{errorDetails && <ErrorDetails errorDetails={errorDetails} />}
{this._drawImage()}
</div>
Expand Down

0 comments on commit 0711226

Please sign in to comment.