@ejfdelgado/ejflab-back 1.17.1 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-back",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ejfdelgado/ejflab-back.git"
@@ -18,7 +18,7 @@
18
18
  "license": "ISC",
19
19
  "private": false,
20
20
  "dependencies": {
21
- "@ejfdelgado/ejflab-common": "1.11.1",
21
+ "@ejfdelgado/ejflab-common": "1.11.2",
22
22
  "@google-cloud/compute": "^4.7.0",
23
23
  "@google-cloud/firestore": "^7.9.0",
24
24
  "@google-cloud/storage": "^7.11.3",
@@ -4,11 +4,14 @@ import { MainHandler } from "./MainHandler.mjs";
4
4
  import { MyTemplate } from "@ejfdelgado/ejflab-common/src/MyTemplate.js";
5
5
  import { General } from "./common/General.mjs";
6
6
  import MyDatesBack from "@ejfdelgado/ejflab-common/src/MyDatesBack.mjs";
7
+ import * as sortifyModule from "@ejfdelgado/ejflab-common/src/sortify.js";
8
+
9
+ const sortify = sortifyModule.default;
7
10
 
8
11
  export class EmailHandler {
9
12
  static async send(req, res) {
10
13
  const useDebug = false;
11
- console.log(`Using SEND_GRID_VARIABLE ${process.env.SEND_GRID_VARIABLE.substring(0, 5)}...`);
14
+ console.log(`Using SEND_GRID_VARIABLE ${JSON.stringify(process.env.SEND_GRID_VARIABLE.substring(0, 7))}...`);
12
15
  sgMail.setApiKey(
13
16
  process.env.SEND_GRID_VARIABLE
14
17
  );
@@ -41,6 +44,7 @@ export class EmailHandler {
41
44
  html: contenidoFinal,
42
45
  };
43
46
 
47
+ console.log(`Using EMAIL_SENDER ${JSON.stringify(MyConstants.EMAIL_SENDER)}`);
44
48
  //console.log(JSON.stringify(body.params, null, 4));
45
49
  //console.log(JSON.stringify(contenidoFinal, null, 4));
46
50
 
@@ -48,7 +52,12 @@ export class EmailHandler {
48
52
  res.status(200).set({ 'content-type': 'text/html; charset=utf-8' }).send(contenidoFinal).end();
49
53
  } else {
50
54
  let answer = {};
51
- answer = await sgMail.send(msg);
55
+ try {
56
+ answer = await sgMail.send(msg);
57
+ } catch (err) {
58
+ console.log(sortify(err));
59
+ throw err;
60
+ }
52
61
  res.status(200).json(answer).end();
53
62
  }
54
63
  }