Retrieve Xojo Line Number when using Plugin?

Is there a way to retrieve a line number in Xojo that has an error from a plugin? There is no Nil-Object-Exception, since this is with a plugin.

As an example, here is a snippet of code where an Index Buffer is used in OpenGL. The error is with GL_INT and should be GL_UNSIGNED_INT

This is on Xojo line number 191. When errors are cleared and logged in multiple places for troubleshooting, it is time-consuming to determine the line number.

The error when using the wrong data type will not show any drawing on the OpenGL window.

Without using Nil-Object-Exception, is there a way to return line number 191 in Xojo 2022 r3.2 on Windows 11?

Warm regards,

Edit: Fixed Spelling Mistakes

You probably should be throwing your own custom exception from the plugin. Then you get line number of course and you ca also have any custom data you want additionally on your exception.

Hi @Björn_Eiríksson,

I will create a custom exception to trigger the exception.

Thank you.

1 Like

I recently made a feature request for this:

Thanks @Jeremie_L,

It has been upvoted.

1 Like