Skip to content

Commit 987559b

Browse files
fixed error handling bug in document frame
1 parent ba1ca77 commit 987559b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/viewer/documentFrame.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,15 @@ DocumentFrame.prototype.filterFrame = function(loadRenderer){
148148
this.applyRules(false, false, myfilt);
149149
}
150150

151-
DocumentFrame.prototype.setErrors = function(errors){
152-
this.clearErrors()
153-
let frameconf = TerminusClient.View.document()
151+
DocumentFrame.prototype.setErrors = function(errors, frameconf){
152+
this.clearErrors(frameconf)
154153
for(var i = 0; i<errors.length; i++){
155154
addRuleForVio(frameconf, errors[i])
156155
}
157156
this.applyRules(false, frameconf);
158157
}
159158

160-
DocumentFrame.prototype.clearErrors = function(){
159+
DocumentFrame.prototype.clearErrors = function(frameconf){
161160
frameconf.all().errors(false)
162161
this.applyRules(false, frameconf)
163162
}
@@ -168,7 +167,7 @@ function addRuleForVio(docview, error){
168167
let val = (error['api:value'] ? error['api:value']["@value"] : false)
169168
let type = (error['api:type'] ? error['api:type']["@value"] : false)
170169
if(type && val){ //api:BadCast
171-
frameconf.data().value(val).range(type).errors([error])
170+
docview.data().value(val).range(type).errors([error])
172171
}
173172
}
174173

0 commit comments

Comments
 (0)