@@ -127,19 +127,31 @@ function loadDFG!(dfgLoadInto::AbstractDFG, dst::AbstractString)
127
127
varFiles = readdir (varFolder)
128
128
factorFiles = readdir (factorFolder)
129
129
@showprogress 1 " loading variables" for varFile in varFiles
130
- packedData = read (" $varFolder /$varFile " , String)
131
- packedData = JSON3. read (packedData, PackedVariable)
132
- push! (variables, unpackVariable (packedData))
130
+ try
131
+ jstr = read (" $varFolder /$varFile " , String)
132
+ packedData = JSON3. read (jstr, PackedVariable)
133
+ push! (variables, unpackVariable (packedData))
134
+ catch ex
135
+ @error (" JSON3 is having trouble reading $varFolder /$varFile into a PackedVariable" )
136
+ @show jstr
137
+ throw (ex)
138
+ end
133
139
end
134
140
@info " Loaded $(length (variables)) variables - $(map (v-> v. label, variables)) "
135
141
@info " Inserting variables into graph..."
136
142
# Adding variables
137
143
map (v-> addVariable! (dfgLoadInto, v), variables)
138
144
139
145
@showprogress 1 " loading factors" for factorFile in factorFiles
140
- packedData = read (" $factorFolder /$factorFile " , String)
141
- packedData = JSON3. read (packedData, PackedFactor)
142
- push! (factors, unpackFactor (dfgLoadInto, packedData))
146
+ try
147
+ jstr = read (" $factorFolder /$factorFile " , String)
148
+ packedData = JSON3. read (jstr, PackedFactor)
149
+ push! (factors, unpackFactor (dfgLoadInto, packedData))
150
+ catch ex
151
+ @error (" JSON3 is having trouble reading $factorFolder /$factorFile into a PackedFactor" )
152
+ @show jstr
153
+ throw (ex)
154
+ end
143
155
end
144
156
@info " Loaded $(length (variables)) factors - $(map (f-> f. label, factors)) "
145
157
@info " Inserting factors into graph..."
0 commit comments