File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/reputation-miner/bin Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -79,20 +79,19 @@ async function main() {
7979 const { data } = await axios . get ( `http://localhost:${ 3001 } /${ req . originalUrl } ` ) ;
8080 res . send ( data ) ;
8181 } catch ( e ) {
82- console . log ( 'Local reputation request failed, try upstream URL:' ) ;
82+ console . log ( 'Local reputation request failed, trying upstream URL:' ) ;
8383 // If the local oracle fails, query the upstream oracle.
8484 console . log ( `${ process . env . REPUTATION_URL } /${ req . originalUrl } ` )
8585 try {
8686
8787 const { data } = await axios ( {
8888 url : `${ process . env . REPUTATION_URL } /${ req . originalUrl } ` ,
89- responseType : "stream" ,
9089 } ) ;
9190
9291 res . send ( data ) ;
9392 } catch ( e2 ) {
94- console . log ( 'Upstream reputation request failed' ) ;
95- res . status ( 500 ) . send ( e2 ) ;
93+ console . log ( 'Upstream reputation request failed, forwarding result ' ) ;
94+ res . status ( e2 . response . status ) . send ( await e2 . response . data ) ;
9695 }
9796 }
9897 } ) ;
You can’t perform that action at this time.
0 commit comments