Code example for DOMException

0
            throw new DOMException(DOMException.SYNTAX_ERR,
                e.getLocalizedMessage());
        } 
        catch (IOException e)
        { 
            throw new DOMException(DOMException.NOT_FOUND_ERR,
                e.getLocalizedMessage());
        } 
    } 
 
    public int getLength() { 
        return this.media.size();
    } 
 
    public String item(int index) {
        return (index < this.media.size()) ? this.media.get(index) : null;
    } 
 
    public void deleteMedium(String oldMedium) throws DOMException {
        for (int i = 0; i < this.media.size(); i++) {
            String str = this.media.get(i);