Skip to content

Commit

Permalink
Add variable name in errors to help debugging (#2605)
Browse files Browse the repository at this point in the history
Small changes to error messages to add vairable names. I had to do this
to debug some code, and I figured I might as well push it :P
  • Loading branch information
brisvag authored Jul 19, 2024
1 parent 8b325a8 commit 283992a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vispy/gloo/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def __setitem__(self, name, data):
data = TextureCube(data)
else:
# This should not happen
raise RuntimeError('Unknown type %s' % type_)
raise RuntimeError('Unknown type %s for %s' % (type_, name))
# Store and send GLIR command
self._user_variables[name] = data
self.glir.associate(data.glir)
Expand Down Expand Up @@ -442,7 +442,7 @@ def isscalar(x):
self._glir.command('ATTRIBUTE', self._id,
name, type_, value, divisor)
else:
raise KeyError('Cannot set data for a %s.' % kind)
raise KeyError('Cannot set data for a %s (%s).' % (kind, name))
else:
# This variable is not defined in the current source code,
# so we cannot establish whether this is a uniform or
Expand Down

0 comments on commit 283992a

Please sign in to comment.
  NODES
COMMUNITY 1
Note 1
Project 3
USERS 1