cfpb / regulations-site

(DEPRECATED) Web interface for viewing U.S. federal regulations and other regulatory information
Other
28 stars 43 forks source link

don't crash when the layer indices don't line up right #757

Closed grapesmoker closed 8 years ago

grapesmoker commented 8 years ago

If the interpolation offsets are missing, regsite crashes. This is bad.

cmc333333 commented 8 years ago

Just a heads up that this also means your data is corrupted

grapesmoker commented 8 years ago

I wouldn't say "corrupted;" I'd say it doesn't conform to the assumptions that regsite is relying on. Which is bad and we need to know about it, but it's also not something that should bring down regsite entirely, which is what it's doing now. I'd much prefer to be notified about this in the console and be able to debug it at my leisure than have the entire thing go down because somewhere there's a reference that doesn't quite line up correctly.

cmc333333 commented 8 years ago

I agree absolutely about not bringing down site. However, the fact that this error is arising is bad news for your data's consistency. Effectively, the layer data is saying "Replace the nth instance of this substring", but when it's trying to apply that logic, it can't find the nth substring. This means either the layer data doesn't match the tree or the logic in -site is removing one of these substrings before it should.

grapesmoker commented 8 years ago

Right, I understand what it's trying to do. And it is bad news, just not bad enough to stop everything. It's definitely not something we should be allowing to continue to happen, but the worst thing that occurs in this case is that some markup doesn't get inlined. That's not great, but it shouldn't be fatal.

cmc333333 commented 8 years ago

:+1:

willbarton commented 8 years ago

batman-thumbs-up