File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22const url = require ( 'url' )
33
44const config = require ( '../../config' )
5+ const logger = require ( '../../logger' )
56
67exports . uploadImage = function ( imagePath , callback ) {
78 if ( ! imagePath || typeof imagePath !== 'string' ) {
@@ -10,7 +11,7 @@ exports.uploadImage = function (imagePath, callback) {
1011 }
1112
1213 if ( ! callback || typeof callback !== 'function' ) {
13- callback ( new Error ( 'Callback has to be a function' ) , null )
14+ logger . error ( 'Callback has to be a function' )
1415 return
1516 }
1617
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ exports.uploadImage = function (imagePath, callback) {
1111 }
1212
1313 if ( ! callback || typeof callback !== 'function' ) {
14- callback ( new Error ( 'Callback has to be a function' ) , null )
14+ logger . error ( 'Callback has to be a function' )
1515 return
1616 }
1717
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const path = require('path')
44
55const config = require ( '../../config' )
66const { getImageMimeType} = require ( '../../utils' )
7+ const logger = require ( '../../logger' )
78
89const Minio = require ( 'minio' )
910const minioClient = new Minio . Client ( {
@@ -21,7 +22,7 @@ exports.uploadImage = function (imagePath, callback) {
2122 }
2223
2324 if ( ! callback || typeof callback !== 'function' ) {
24- callback ( new Error ( 'Callback has to be a function' ) , null )
25+ logger . error ( 'Callback has to be a function' )
2526 return
2627 }
2728
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const path = require('path')
44
55const config = require ( '../../config' )
66const { getImageMimeType} = require ( '../../utils' )
7+ const logger = require ( '../../logger' )
78
89const AWS = require ( 'aws-sdk' )
910const awsConfig = new AWS . Config ( config . s3 )
@@ -16,7 +17,7 @@ exports.uploadImage = function (imagePath, callback) {
1617 }
1718
1819 if ( ! callback || typeof callback !== 'function' ) {
19- callback ( new Error ( 'Callback has to be a function' ) , null )
20+ logger . error ( 'Callback has to be a function' )
2021 return
2122 }
2223
You can’t perform that action at this time.
0 commit comments