@@ -24,7 +24,7 @@ const UserParam = require("../../api/filesystem/UserParam");
24
24
const config = require ( "../../config" ) ;
25
25
const { chkperm, validate_fsentry_name } = require ( "../../helpers" ) ;
26
26
const { TeePromise } = require ( "../../util/promise" ) ;
27
- const { pausing_tee, logging_stream, offset_write_stream } = require ( "../../util/streamutil" ) ;
27
+ const { pausing_tee, logging_stream, offset_write_stream, stream_to_the_void } = require ( "../../util/streamutil" ) ;
28
28
const { TYPE_DIRECTORY } = require ( "../FSNodeContext" ) ;
29
29
const { LLRead } = require ( "../ll_operations/ll_read" ) ;
30
30
const { RootNodeSelector, NodePathSelector } = require ( "../node/selectors" ) ;
@@ -299,7 +299,7 @@ class HLWrite extends HLFilesystemOperation {
299
299
this . checkpoint ( 'before thumbnail' ) ;
300
300
301
301
let thumbnail_promise = new TeePromise ( ) ;
302
- let thumbnail ; ( async ( ) => {
302
+ ( async ( ) => {
303
303
const reason = await ( async ( ) => {
304
304
const { mime } = this . modules ;
305
305
const thumbnails = context . get ( 'services' ) . get ( 'thumbnails' ) ;
@@ -324,7 +324,13 @@ class HLWrite extends HLFilesystemOperation {
324
324
return { ...values . file , stream : thumbnail_stream } ;
325
325
} ) ( ) ;
326
326
327
- thumbnail = await thumbnails . thumbify ( thumb_file ) ;
327
+ let thumbnail ;
328
+ try {
329
+ thumbnail = await thumbnails . thumbify ( thumb_file ) ;
330
+ } catch ( e ) {
331
+ stream_to_the_void ( thumb_file . stream ) ;
332
+ return 'thumbnail error: ' + e . message ;
333
+ }
328
334
thumbnail_promise . resolve ( thumbnail ) ;
329
335
} ) ( ) ;
330
336
if ( reason ) {
0 commit comments