Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

lisk.api().sendRequest() should check validity of its params #103

Closed
slaweet opened this issue Apr 18, 2017 · 0 comments
Closed

lisk.api().sendRequest() should check validity of its params #103

slaweet opened this issue Apr 18, 2017 · 0 comments

Comments

@slaweet
Copy link
Contributor

slaweet commented Apr 18, 2017

Expected behaviour

Uncaught Invalid parameter value: 'limit'
In browser console it should throw and error saying something like:

> lisk.api().sendRequest('delegates/', {limit:undefined})
TypeError: sendRequest was called Invalid value 'undefined' of parameter 'limit'

Actual behaviour

In browser console:

> lisk.api().sendRequest('delegates/', {limit:undefined})
liskApi.js?e8ff:293 Uncaught TypeError: this.trimObj is not a function
    at eval (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:293:130)
    at Array.reduce (native)
    at LiskAPI.trimObj (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:292:26)
    at LiskAPI.serialiseHttpData (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:282:20)
    at LiskAPI.changeRequest (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:247:59)
    at LiskAPI.sendRequestPromise (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:214:28)
    at LiskAPI.sendRequest (eval at <anonymous> (http://localhost:8080/app.js:4799:2), <anonymous>:189:14)
    at <anonymous>:1:12

It makes it difficult to figure out what actually went wrong if there are more calls and more parameters.

@toschdev toschdev added this to Ready in Version 0.4.1 Apr 20, 2017
@karmacoma karmacoma added this to the Version 0.4.1 milestone Apr 20, 2017
@toschdev toschdev moved this from Ready to In Progress in Version 0.4.1 Apr 24, 2017
@karmacoma karmacoma removed this from In Progress in Version 0.4.1 Apr 27, 2017
@toschdev toschdev added this to Closed Issues in Sprint Board 04-09-17 Sep 8, 2017
@toschdev toschdev removed this from Closed Issues in Sprint Board 04-09-17 Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants