Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1171: Display camera error message in UI when testing #1173

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ class RtspCameraBox extends Component {
try {
await this.props.testConnection(this.props.cameraIndex);
this.setState({
testConnectionError: null
testConnectionError: null,
testConnectionErrorMessage: null
});
} catch (e) {
this.setState({
testConnectionError: RequestStatus.Error
testConnectionError: RequestStatus.Error,
testConnectionErrorMessage: get(e, 'response.data.error')
});
}
this.setState({
Expand All @@ -72,7 +74,7 @@ class RtspCameraBox extends Component {
};
componentWillMount() {}

render(props, { loading, saveError, testConnectionError }) {
render(props, { loading, saveError, testConnectionError, testConnectionErrorMessage }) {
return (
<div class="col-md-4">
<div class="card">
Expand All @@ -97,6 +99,7 @@ class RtspCameraBox extends Component {
<Text id="integration.rtspCamera.testConnectionError" />
</div>
)}
{testConnectionErrorMessage && <div class="alert alert-danger">{testConnectionErrorMessage}</div>}
<div class="form-group">
<label>
<Text id="integration.rtspCamera.nameLabel" />
Expand Down