Skip to content

Commit

Permalink
Fixed catch block for mouselightapi example
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Oct 22, 2024
1 parent f43b688 commit 783b74f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/neurons.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from morphapi.api.mouselight import MouseLightAPI
from myterial import orange
from rich import print
from urllib3.exceptions import NewConnectionError, MaxRetryError

from brainrender import Scene
from brainrender.actors import Neuron, make_neurons
Expand All @@ -28,7 +29,12 @@
to_add = [neurons_metadata[47], neurons_metadata[51]]
neurons = mlapi.download_neurons(to_add)
neurons = scene.add(*make_neurons(*neurons, neurite_radius=12))
except ConnectionError or requests.exceptions.ReadTimeout as e:
except (
NewConnectionError,
MaxRetryError,
requests.exceptions.ConnectionError,
requests.exceptions.ReadTimeout,
) as e:
print("Failed to download neurons data from neuromorpho.org.")

# Render!
Expand Down

0 comments on commit 783b74f

Please sign in to comment.