Skip to content

Commit

Permalink
Add error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbaka committed Jun 22, 2018
1 parent 0c59879 commit 7281130
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/session_recording/player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@
drag_pan: false,
containerWidth: 630,
currentTsPost: 0,
scale: 1
scale: 1,
error: null
};

this.containerHeight = 290;
Expand Down Expand Up @@ -626,6 +627,7 @@
/* Handle packet retrieval error */
handleError(error) {
if (error !== null) {
this.setState({error: error});
console.warn(error);
}
}
Expand Down Expand Up @@ -973,6 +975,18 @@
return currentTS;
};

let error = "";
if (this.state.error) {
error = (
<div className="alert alert-danger alert-dismissable" >
<button type="button" className="close" data-dismiss="alert" aria-hidden="true">
<span className="pficon pficon-close" />
</button>
<span className="pficon pficon-error-circle-o" />
{this.state.error}.
</div>);
}

// ensure react never reuses this div by keying it with the terminal widget
return (
<div ref="wrapper" className="panel panel-default">
Expand Down Expand Up @@ -1039,6 +1053,7 @@
fastForwardFunc={this.fastForwardToTS}/>
</div>
</div>
{error}
</div>
);
}
Expand Down

0 comments on commit 7281130

Please sign in to comment.