summaryrefslogtreecommitdiffstats
path: root/acf/model/model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/model/model.lua')
-rw-r--r--acf/model/model.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/acf/model/model.lua b/acf/model/model.lua
index 2efcb6f..6186d04 100644
--- a/acf/model/model.lua
+++ b/acf/model/model.lua
@@ -1,10 +1,12 @@
--[[
-Copyright (c) 2012 Kaarle Ritvanen
+Copyright (c) 2012-2013 Kaarle Ritvanen
See LICENSE file for license details
--]]
module(..., package.seeall)
+local raise = require('acf.error').raise
+
local fld = require('acf.model.field')
local Field = fld.Field
@@ -88,7 +90,7 @@ function Model:init(txn, path, addr)
function mt.__newindex(t, k, v)
local f = mt.field(k)
- if not f then error('Field named '..k..' does not exist') end
+ if not f then raise(mt.path, 'Field named '..k..' does not exist') end
f:save(v)
txn.validate[mt.path] = function() self:validate() end
end