Fix "unknown resource RuntimeException" error from raise statement