if fails to create a DOMException create an Error instead and warn on console if DEBUG