Browse Source

added console.log output if error in the routes

the error wasn't being sent to the user, but should be sent to log to inspect later.
master
Blaine Motsinger 1 year ago
parent
commit
5377db436f
2 changed files with 4 additions and 0 deletions
  1. 2
    0
      routes/api/notes.js
  2. 2
    0
      routes/index.js

+ 2
- 0
routes/api/notes.js View File

@@ -16,6 +16,8 @@ router.get( '/', function( req, res ) {
.send( JSON.stringify( rows || [] ) );
})
.catch( function( err ) {
console.log( err );

res.status( 500 )
.header( 'Content-Type', 'text/plain' )
.send( 'Database Error' );

+ 2
- 0
routes/index.js View File

@@ -16,6 +16,8 @@ router.get( '/', function ( req, res ) {
res.render( 'index', { rows: rows } );
})
.catch( function( err ) {
console.log( err );

res.status( 500 )
.header( 'Content-Type', 'text/plain' )
.send( 'Database Error' );

Loading…
Cancel
Save