流星。在调用期间没有检查()所有参数

时间:2014-12-14 19:03:14

标签: exception meteor

我的流星日志充满了这些错误:

Exception while invoking method 'updateShotTitle' Error: Did not check() all arguments during call to 'updateShotTitle'
    at _.extend.throwUnlessAllArgumentsHaveBeenChecked (packages/check/match.js:352)
    at Object.Match._failIfArgumentsAreNotAllChecked (packages/check/match.js:108)
    at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1596)
    at packages/ddp/livedata_server.js:648
    at _.extend.withValue (packages/meteor/dynamics_nodejs.js:56)
    at packages/ddp/livedata_server.js:647
    at _.extend.withValue (packages/meteor/dynamics_nodejs.js:56)
    at _.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646)
    at packages/ddp/livedata_server.js:546

这是客户端代码:

keypress .info-title-input': (e) ->
     if e.keyCode == 13
          name = $(e.currentTarget).val()
          file_name = @.file_name
          shot_id = @.shot_parent
          check(shot_id, String)
          check(file_name, String)
          check(name, Match.Any)

          Meteor.call("updateShotTitle", shot_id, file_name, name)

在方法中也是检查,但没有什么能帮助我理解为什么会发生这种情况

updateShotTitle: (shot_id, file_name, title) ->
    check(shot_id, Match.Any)
    check(file_name, Match.Any)
    check(title, Match.Any)

    Shots.update(
      { shot_id: shot_id, "images.file_name": file_name },
      { $set: { "images.$.title":  title  } }
    )

这并不是唯一能让我犯这种错误的方法,几乎​​所有这些方法都会抛出这种异常。我做错了什么?

0 个答案:

没有答案