|
143 | 143 | import com.oracle.graal.python.lib.PyNumberAsSizeNode;
|
144 | 144 | import com.oracle.graal.python.lib.PyObjectHashNode;
|
145 | 145 | import com.oracle.graal.python.lib.PyObjectHashNodeGen;
|
| 146 | +import com.oracle.graal.python.nodes.PConstructAndRaiseNode; |
146 | 147 | import com.oracle.graal.python.nodes.PGuards;
|
147 | 148 | import com.oracle.graal.python.nodes.PNodeWithRaise;
|
148 | 149 | import com.oracle.graal.python.nodes.PRaiseNode;
|
@@ -269,9 +270,12 @@ public void postInitialize(Python3Core core) {
|
269 | 270 | CApiContext cApiContext = CApiContext.ensureCapiWasLoaded(null, context, T_EMPTY_STRING, T_EMPTY_STRING);
|
270 | 271 | handle = new DLHandler(cApiContext.getLLVMLibrary(), 0, J_EMPTY_STRING, true);
|
271 | 272 | setCtypeLLVMHelpers(this, context, handle);
|
272 |
| - } catch (IOException | ImportException | ApiInitException e) { |
273 |
| - // TODO(fa): properly handle errors |
274 |
| - throw CompilerDirectives.shouldNotReachHere(); |
| 273 | + } catch (ApiInitException e) { |
| 274 | + throw e.reraise(PConstructAndRaiseNode.getUncached(), null); |
| 275 | + } catch (ImportException e) { |
| 276 | + throw e.reraise(PConstructAndRaiseNode.getUncached(), null); |
| 277 | + } catch (IOException e) { |
| 278 | + throw PConstructAndRaiseNode.getUncached().raiseOSError(null, e, EqualNode.getUncached()); |
275 | 279 | }
|
276 | 280 | }
|
277 | 281 | NativeFunction memmove = MemMoveFunction.create(handle, context);
|
|
0 commit comments