โ10-04-2022 11:46 PM
I'm attempting to mount a volume using dbutils.fs.mount in a python workbook
in the exception handling for this statement, I have found an exception that doesn't get caught using the standard try/except handling
for example, if passing through a container name that does not exist I get the following exception - but it is not caught
ExecutionError: An error occurred while calling o390.mount.
: java.io.FileNotFoundException: /: No such file or directory.
Is there an approach to catch a java.io.Exception within a python notebook?
โ10-06-2022 01:22 AM
Hi @Stuart Parkerโ , Could you please check in the Data/DBFS page if the file is there (or via dbutils.fs.ls, https://docs.databricks.com/dev-tools/databricks-utils.html)?
โ10-13-2022 06:36 PM
Hi @Debayan Mukherjeeโ
The issue is not a file one. In the workbook that mounted the container, the container name was mis-typed. Despite the mount command being wrapped in a try..catch.. block, it was not caught and this error bubbled up and threw an exception that stopped the workbook.
My question relates to how to handle future events like this where standard pythonic exception handling doesn't work
โ10-13-2022 08:29 AM
If except Exception as error: is not working, you can check first if container name exists as resource
โ10-13-2022 06:38 PM
Thanks - you are correct - however I am attempting to determine if it is possible to catch the Java error that is bubbling up within the pyspark environment
โ11-12-2022 09:51 PM
Hi @Stuart Parkerโ
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group