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

Method "oncreate" expect to throw "TypeMismatchError" rather than "TypeError" #106

Open
wanghongjuan opened this issue Dec 28, 2016 · 0 comments

Comments

@wanghongjuan
Copy link

Spec defined that If the provided handler argument is not a Function, throw "TypeMismatchError" for oncreate method.

Get information as below:

$ node
> var ocf=require('./index')
undefined
> ocf.server.oncreate("abc")
TypeError: Expected a function
    at createWrap (/home/hj/Downloads/iotivity-node/node_modules/lodash/lodash.js:5557:15)
    at Function.<anonymous> (/home/hj/Downloads/iotivity-node/node_modules/lodash/lodash.js:10102:14)
    at apply (/home/hj/Downloads/iotivity-node/node_modules/lodash/lodash.js:497:27)
    at Function.bind (/home/hj/Downloads/iotivity-node/node_modules/lodash/lodash.js:6585:16)
    at Server._.extend.oncreate (/home/hj/Downloads/iotivity-node/lib/Server.js:181:28)
    at repl:1:12
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant