Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error not displayed with 'Content-Type': 'application/x-www-form-urlencoded' #77

Closed
Samox opened this issue Nov 8, 2016 · 2 comments
Closed
Labels

Comments

@Samox
Copy link

Samox commented Nov 8, 2016

Loopback doesn't catch errors when there are discrepancies between datasources.local.js and datasources.json such as:
in datasources.local.js:

functions: {
  getToken: []
},
template: {
  method: 'POST',
  url: process.env.API_URL + 'oauth/token',
  body: {
    client_id: 'id',
    client_secret: 'secret'
  },
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  }
}

and in datasources.json:

"template": {
  "method": "POST",
  "url": "http://0.0.0.0:3394/api/oauth/token/"
},
"functions": {
  "getToken": []
}

The request is made in the connector
loopback:connector:rest Transformed request: {}...
loopback:connector:rest Request: {}...
But no response, nor error, nor crash. No idea what is happening.

Finally, when I added the headers in datasources.json, the error 'uncaughtException: first argument must be a string or Buffer' appeared.
I guess there are other error messages that are not displayed when you have discrepancies in your config files.

I'd like to fix that to help you but I don't know where to look :)

@stale
Copy link

stale bot commented Aug 22, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Sep 5, 2017
@stale
Copy link

stale bot commented Sep 5, 2017

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants