Skip to content

Commit 75dbaaa

Browse files
authored
Refactor github-card.js for improved error handling
1 parent 4e446b3 commit 75dbaaa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

api/github-card.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ app.use(cors());
88

99
const { getGithubData } = require("../utils/githubData")
1010
const { generateErrorSVG, generateSVG, generateSVG2 } = require("../utils/theSystem")
11-
const { wrapSVGText } = require("../utils/allFunction");
11+
const { wrapSVGText, wrapSVGTextCenter } = require("../utils/allFunction");
1212

1313
// =========================================
1414

@@ -63,6 +63,9 @@ app.get("/api/svg-card/", async (req, res) => {
6363
1150,
6464
160
6565
)
66+
67+
res.setHeader("Content-Type", "image/svg+xml");
68+
return res.send(errorSvg);
6669
});
6770

6871
if (!desc) {
@@ -171,5 +174,6 @@ module.exports = app;
171174

172175

173176

177+
174178

175179

0 commit comments

Comments
 (0)