caliphdev commited on
Commit
bbff16c
·
verified ·
1 Parent(s): aac5803

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -1
index.js CHANGED
@@ -5,6 +5,7 @@ const fs = require('fs');
5
  const nsfwcheck = require('./lib/isporn');
6
  const PORT = process.env.PORT || 4000;
7
  const fetch = require('node-fetch');
 
8
 
9
  app.use(bodyParser.json());
10
  app.use(bodyParser.urlencoded({
@@ -35,7 +36,7 @@ app.get("/api/check", async (req, res) => {
35
  } catch (error) {
36
  res.json({
37
  status: 500,
38
- error: (error.message || "Unknown Error, Please try another photo")
39
  });
40
  console.log(error);
41
  }
 
5
  const nsfwcheck = require('./lib/isporn');
6
  const PORT = process.env.PORT || 4000;
7
  const fetch = require('node-fetch');
8
+ const util = require("util");
9
 
10
  app.use(bodyParser.json());
11
  app.use(bodyParser.urlencoded({
 
36
  } catch (error) {
37
  res.json({
38
  status: 500,
39
+ error: util.format(error || "Unknown Error, Please try another photo")
40
  });
41
  console.log(error);
42
  }