File tree Expand file tree Collapse file tree
services/document_conversion Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ module.exports = function(RED) {
7272 var wstream = fs . createWriteStream ( file ) ;
7373 wstream . on ( 'finish' , function ( ) {
7474 fs . readFile ( file , function ( err , buf ) {
75- if ( err ) console . error ( err ) ;
75+ if ( err ) {
76+ throw ( err ) ;
77+ }
7678 cb ( fileType ( buf ) . ext ) ;
7779 } ) ;
7880 } ) ;
@@ -86,17 +88,16 @@ module.exports = function(RED) {
8688
8789 stream_payload ( info . path , msg . payload , function ( format ) {
8890
89- // convert a document
91+ node . status ( { fill : "blue" , shape : "dot" , text : "converting" } ) ;
9092 document_conversion . convert ( {
91- // (JSON) answer_units, normalized_html, or normalized_text
9293 file : fs . createReadStream ( info . path ) ,
9394 conversion_target : msg . target || node . target ,
94- // Add custom configuration properties or omit for defaults
9595 word : msg . word ,
9696 pdf : msg . pdf ,
9797 normalized_html : msg . normalized_html
9898
9999 } , function ( err , response ) {
100+ node . status ( { } ) ;
100101 if ( err ) {
101102 node . error ( err ) ;
102103 } else {
You can’t perform that action at this time.
0 commit comments