File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,10 @@ function logNodeList(nodes) {
101101 var enabled = node . enabled && ! node . err ;
102102
103103 var types = "" ;
104- for ( var j = 0 ; j < node . types . length ; j ++ ) {
105- types += ( j > 0 ?"\n" :"" ) + ( enabled ?node . types [ j ] :node . types [ j ] ) ;
104+ if ( node . types ) {
105+ for ( var j = 0 ; j < node . types . length ; j ++ ) {
106+ types += ( j > 0 ?"\n" :"" ) + ( enabled ?node . types [ j ] :node . types [ j ] ) ;
107+ }
106108 }
107109 if ( types . length === 0 ) {
108110 types = "none" ;
@@ -147,11 +149,18 @@ module.exports = {
147149 console . log ( msg ) ;
148150 } ,
149151 warn :function ( msg ) {
152+ if ( process . env . NR_TRACE && msg . stack ) {
153+ console . warn ( msg . stack )
154+ }
150155 if ( msg . response ) {
151156 if ( msg . response . status === 401 ) {
152- console . warn ( "Not logged in. Use 'node-red-admin login' to log in." ) ;
157+ console . warn ( "Not logged in. Use 'login' to log in." ) ;
153158 } else if ( msg . response . data ) {
154- console . warn ( msg . response . status + ": " + msg . response . data . message ) ;
159+ if ( msg . response . status === 404 && ! msg . response . data . message ) {
160+ console . warn ( "Node-RED Admin API not found. Use 'target' to set API location" ) ;
161+ } else {
162+ console . warn ( msg . response . status + ": " + msg . response . data . message ) ;
163+ }
155164 } else {
156165 console . warn ( msg . response . status + ": " + msg . toString ( ) ) ;
157166 }
You can’t perform that action at this time.
0 commit comments