OOP "Gefangene" Exception weiterreichen

knowledge

Bekanntes Mitglied
Hallo,

folgendes Problem. Im if-innerhalb des catchs prüf ich die Exception ab, falls a false ist will ich no einfach weiterreichen.

Code:
try {

}
catch(NoSuchFieldException no) {
				if(a) {
					
				}
				else {
				    throw no;	
				}
}

throw no; innerhalb des else bringt mir aber, genau wie ein throw new NoSuchFieldException, "Unhandled Exception type NoSuchFieldException". Ich will doch nur wenn ich die Exception no gefangen habe diese erneut werfen. Das klappt aber so nicht.
 

Zurück
Oben