Fehler beim Versuch, endlich zu fangen

Ich habe Probleme damit, endlich einen Versuch zu fangen, ich komme durch alles in Ordnung, bis die Fänge. Meine Codefehler bei beiden Begriffen "Syntaxfehler bei" catch ", for expected" und ich haben eine Google-Suche durchgeführt und nichts gefunden, was funktioniert hat. Ich habe meinen Code angehängt. Handelt es sich lediglich um einen Platzierungsfehler, oder kann ich nicht die richtige Art von Fehler auslösen? Danke im Voraus.

    public void setOrder(String field, String value) {
    File dir = new File(finished);
    if (!dir.exists())
    {
        try{
            doc = PDDocument.load(file);
            PDDocumentCatalog docCatalog = doc.getDocumentCatalog();
            PDAcroForm acroForm = docCatalog.getAcroForm();
            PDField acrofield = acroForm.getField( field );
            if(value == null){
                acrofield.setValue("");
            }
            else{
                acrofield.setValue(value);
            }
            doc.save(finished);
        }
        finally{
            if( doc != null ){
                doc.close();
            }
        }
        catch(Exception eer){
            eer.printStackTrace();
        }
    }
    else{
        try{
            doc = PDDocument.load(finished);
            PDDocumentCatalog docCatalog = doc.getDocumentCatalog();
            PDAcroForm acroForm = docCatalog.getAcroForm();
            PDField acrofield = acroForm.getField( field );
            if(value == null){
                acrofield.setValue("");
            }
            else{
                acrofield.setValue(value);
            }
            doc.save(finished);
        }
        finally{
            if( doc != null ){
                doc.close();
            }
        }
        catch(Exception eer){
            eer.printStackTrace();
        }
    }
}

Antworten auf die Frage(1)

Ihre Antwort auf die Frage