Closed Bug 640058 Opened 13 years ago Closed 13 years ago

Element._locateElem() should throw an error if element can't be located

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: gmealer, Assigned: gmealer)

References

Details

(Whiteboard: [module-refactor])

Element._locateElem() should guarantee location. Currently, if you attempt to create via any of the elementslib constructors, you might get a null element back. 

_locateElem() should validate itself before returning.
First, my summary was wrong. The Elem would never be null, just the node referenced by it.

However, on further investigation, we're throwing reasonable errors for all construction types:

"node" throws on construction if undefined. 
"tag" already threw a nice error if no nodes were found.

All the rest are legacy Elem constructors, and the controller throws a nice error on first use, which is exactly when we'd be able to throw one as well due to lazy-finding. In fact, in order to do this I'd have to catch the existing controller errors just to throw my own.

Since I'm happy with the existing messages plus Elem/controller are going to fundamentally change anyway, I'm wontfixing this until at least after the Elem/controller redesign in Mozmill 2.0
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Should note, not a bust though, because figuring all this out exposed Bug 641713 :D
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.