MVPStudio / mvp-studio-web-cms

the repo for the static site.
https://mvpstudio.github.io/mvp-studio-web-cms/
MIT License
4 stars 0 forks source link

Refactor formHandler #30

Closed mckelveygreg closed 5 years ago

mckelveygreg commented 5 years ago

I implemented the new code from tuesday, however, when an error is thrown, instead of nicely letting the user know, the user doesn't know and it crashes the server...

C:\Code\real projects\mvp-studio-web-cms\server\formHandler.js:23
    if (err) throw new Error(err);
             ^

Error: Unknown field name: "Name_of_project"(UNKNOWN_FIELD_NAME)[Http code 422]
    at base.create.err (C:\Code\real projects\mvp-studio-web-cms\server\formHandler.js:23:20)
    at C:\Code\real projects\mvp-studio-web-cms\server\node_modules\airtable\lib\table.js:88:24
    at Request._callback (C:\Code\real projects\mvp-studio-web-cms\server\node_modules\airtable\lib\run_action.js:59:9)
    at Request.self.callback (C:\Code\real projects\mvp-studio-web-cms\server\node_modules\request\request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (C:\Code\real projects\mvp-studio-web-cms\server\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (C:\Code\real projects\mvp-studio-web-cms\server\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
[nodemon] app crashed - waiting for file changes before starting...

I changed an airtable column name for testing, and this is what was thrown

The other commits are for a new recaptcha library that actually works. The other one was super buggy and wouldn't allow you to submit another form on refresh. That all works fine.

mckelveygreg commented 5 years ago

I wasn't able to implement the new server changes, but i wanted to merge this branch anyway because of some UI changes. On tuesday, can we revamp the server code then?