fDOMError.fSeverity = DOMError.SEVERITY_ERROR;
fDOMError.fException = exception;
// REVISIT: May need to lookup from DOMErrorTypeMap in the future.
fDOMError.fType = key;
fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
DOMLocatorImpl locator = fDOMError.fLocator;
if (locator != null) {
locator.fColumnNumber = exception.getColumnNumber();
locator.fLineNumber = exception.getLineNumber();
locator.fUtf16Offset = exception.getCharacterOffset();
locator.fUri = exception.getExpandedSystemId();