mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
screenshots: Put try catch inside jimp promise
Change-Id: I3c72f024f740a2af882a7651c77ba017ad2e2e97
This commit is contained in:
parent
57faec4353
commit
a6d0ca80cf
|
@ -66,16 +66,16 @@ function createScreenshotEnvironment( test ) {
|
|||
const right = Math.min( clientSize.width, rect.left + rect.width + padding );
|
||||
const bottom = Math.min( clientSize.height, rect.top + rect.height + padding );
|
||||
|
||||
try {
|
||||
return Jimp.read( imageBuffer ).then( function ( jimpImage ) {
|
||||
try {
|
||||
jimpImage
|
||||
.crop( left, top, right - left, bottom - top )
|
||||
.write( filename );
|
||||
} );
|
||||
} catch ( e ) {
|
||||
// Log error (memory?)
|
||||
console.error( e );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
function runScreenshotTest( name, lang, clientScript, padding ) {
|
||||
|
|
Loading…
Reference in a new issue