Remove extra param from createForVideoFrameProcessingException

This arg was always the same value, so it can be simplified.

PiperOrigin-RevId: 525677735
This commit is contained in:
huangdarwin 2023-04-20 09:27:49 +01:00 committed by Rohit Singh
parent 316a2ce0ee
commit 3bc0172188
2 changed files with 7 additions and 7 deletions

View File

@ -284,12 +284,14 @@ public final class ExportException extends Exception {
* Creates an instance for a {@link VideoFrameProcessor} related exception.
*
* @param cause The cause of the failure.
* @param errorCode See {@link #errorCode}.
* @return The created instance.
*/
/* package */ static ExportException createForVideoFrameProcessingException(
VideoFrameProcessingException cause, int errorCode) {
return new ExportException("Video frame processing error", cause, errorCode);
VideoFrameProcessingException cause) {
return new ExportException(
"Video frame processing error",
cause,
ExportException.ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED);
}
/**

View File

@ -164,8 +164,7 @@ import org.checkerframework.dataflow.qual.Pure;
@Override
public void onError(VideoFrameProcessingException exception) {
errorConsumer.accept(
ExportException.createForVideoFrameProcessingException(
exception, ExportException.ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED));
ExportException.createForVideoFrameProcessingException(exception));
}
@Override
@ -180,8 +179,7 @@ import org.checkerframework.dataflow.qual.Pure;
}
});
} catch (VideoFrameProcessingException e) {
throw ExportException.createForVideoFrameProcessingException(
e, ExportException.ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED);
throw ExportException.createForVideoFrameProcessingException(e);
}
}