@@ -116,15 +116,15 @@ export default class PluginsCommonService {
116116 rejectWithIdentifyError ( pluginName , step , candidate , err , context ) {
117117 let { status, message, mustBeReported} = err ;
118118 mustBeReported = isSet ( mustBeReported ) ? mustBeReported : true ;
119- let plantnetTxtError = `[${ step } ] Impossible d'identifier l'image avec ${ pluginName } ` ;
120- let plantnetHtmlError = plantnetTxtError ;
119+ let pluginTxtError = `[${ step } ] Impossible d'identifier l'image avec ${ pluginName } ` ;
120+ let pluginHtmlError = pluginTxtError ;
121121 if ( isSet ( candidate ) ) {
122- plantnetTxtError = `[${ step } ] Impossible d'identifier l'image de ${ postLinkOf ( candidate ) } avec ${ pluginName } ` ;
123- plantnetHtmlError = `<b>Post</b>: <div class="bg-warning">${ postHtmlOf ( candidate ) } </div>` +
122+ pluginTxtError = `[${ step } ] Impossible d'identifier l'image de ${ postLinkOf ( candidate ) } avec ${ pluginName } ` ;
123+ pluginHtmlError = `<b>Post</b>: <div class="bg-warning">${ postHtmlOf ( candidate ) } </div>` +
124124 `<b>Erreur [${ step } ]</b>: impossible d'identifier l'image avec ${ pluginName } ` ;
125125 }
126- this . logger . error ( `${ plantnetTxtError } : ${ message } ` , context ) ;
127- return Promise . reject ( pluginReject ( plantnetTxtError , plantnetHtmlError ,
126+ this . logger . error ( `${ pluginTxtError } : ${ message } ` , context ) ;
127+ return Promise . reject ( pluginReject ( pluginTxtError , pluginHtmlError ,
128128 isSet ( status ) ? status : 500 ,
129129 `${ pluginName } unexpected error` , mustBeReported ) ) ;
130130 }
@@ -204,7 +204,8 @@ export default class PluginsCommonService {
204204 ) ) ;
205205 } )
206206 . catch ( err => {
207- console . log ( err . stack ) ; // print stack
207+ console . log ( err ) ; // print err
208+ console . log ( err ?. stack ) ; // print stack
208209 console . trace ( ) ; // print stack
209210 plugin . logError ( "replyTo" , err , { ...context , doSimulate, replyTo, replyMessage} ) ;
210211 reject ( new Error ( "impossible de répondre au post" ) ) ;
0 commit comments