screenshot: Show a special error when screencast ran out of disk space
Since we now propagate error types back to gnome-shell now, let's start with showing a special error message in case the disk ran out of space, which is probably the most typical error. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2976>
This commit is contained in:
@ -363,9 +363,15 @@ class Recorder extends Signals.EventEmitter {
|
||||
case PipelineState.PLAYING:
|
||||
case PipelineState.FLUSHING: {
|
||||
const [error] = message.parse_error();
|
||||
this._handleFatalPipelineError(
|
||||
`GStreamer error while in state ${this._pipelineState}: ${error.message}`,
|
||||
ScreencastErrors, ScreencastError.PIPELINE_ERROR);
|
||||
|
||||
if (error.matches(Gst.ResourceError, Gst.ResourceError.NO_SPACE_LEFT)) {
|
||||
this._handleFatalPipelineError('Out of disk space',
|
||||
ScreencastErrors, ScreencastError.OUT_OF_DISK_SPACE);
|
||||
} else {
|
||||
this._handleFatalPipelineError(
|
||||
`GStreamer error while in state ${this._pipelineState}: ${error.message}`,
|
||||
ScreencastErrors, ScreencastError.PIPELINE_ERROR);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user