【问题标题】:Capturing error of entity.entityAspect.entityManager.createEntity捕获 entity.entityAspect.entityManager.createEntity 的错误
【发布时间】:2015-10-30 19:14:35
【问题描述】:

当我运行以下代码时 -

this.entity.entityAspect.entityManager.createEntity('TblReceipt', {

ReceiptNo : 123
....
});

代码第一次运行良好并创建了新实体。现在,当用户尝试再次运行它时,会出现以下错误 -

   Uncaught Error: A MergeStrategy of 'Disallowed' does not allow you to attach     an entity when an entity with the same key is already attached"

上述错误显示在控制台中。如何在 javascript 代码中捕获此错误并向用户显示消息?

谢谢

【问题讨论】:

    标签: breeze


    【解决方案1】:

    是的,明白了。只需将它们包装在 try catch 块中 -

    try {
    
    }
    Catch(error)
    {
    
    }
    

    【讨论】:

      猜你喜欢
      • 2023-03-28
      • 1970-01-01
      • 2022-01-18
      • 2021-07-26
      • 2017-03-26
      • 1970-01-01
      • 2019-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多