# How to view full error text when truncated

**URL:** <https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 9, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176 "2025-06-09T13:01:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/1 "2025-06-09T13:01:41Z")

</div>

Hi all  
I'm getting the following error message but it's truncated and I can't work out how to get the whole thing to show/ copy into a text editor.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/a/0ace71ee7c2cbe01cea8a0f376fef9ccdc6ab690.png)

I've tried clicking on the ellipses, but that doesn't seem to do anything, and neither does clicking on the red triangle in the property editor.  
Please use step by step directions and small words...

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 9, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/2 "2025-06-09T13:42:21Z")

</div>

Unfortunately, there isn't a good way to get to it from the designer.

Surround the calling code `getAnyBatchesAvailable()` with a Try...Except, being sure to catch both the Python `Exception` and the `java.lang.Throwable`

Something like:

```python
from java.lang import Throwable

myLogger = system.util.getLogger("MyLoggerName")

#some code
try:
   getAnyBatchesAvailable()
except e as Exception:
   myLogger.infof("There was an errror! %s", e.cause)
except t as java.lang.Throwable:
   myLogger.info(t)

#the rest of the code

```

Then you will be able to find the error message in the Logs on the Gateway.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 9, 2025, 1:51pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/3 "2025-06-09T13:51:35Z")

</div>

I have no idea where that tooltip screenshot is coming from, but have you checked your console?

---

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 2:02pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/4 "2025-06-09T14:02:29Z")

</div>

I'll give that a bash @lrose , thanks!

---

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 2:03pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/5 "2025-06-09T14:03:46Z")

</div>

I have checked the console, yes. It is for some reason very choosy about what errors it decides to report.  
These ones are not there.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [June 9, 2025, 2:06pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/6 "2025-06-09T14:06:38Z")

</div>

This is just good practice anyways fyi OP. Any business logic should be done in a try/except and with appropriate steps logged, errors logged.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 9, 2025, 2:09pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/7 "2025-06-09T14:09:38Z")

</div>

> [@lrose](#):
>
> `e.cause`

This is a bad practice. Not all exceptions are layered with a chain of causes, and when not, that construct will entirely miss the real reason. Use the [LoggerEx](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.47/com/inductiveautomation/ignition/common/util/LoggerEx.html) methods that take a `Throwable` to dump complete tracebacks into the logs. Use `later.PythonAsJavaException` or [system.reflection.asThrowable()](https://www.automation-pros.com/toolkit/doc/reflection.html#asthrowable) to make Jython exceptions logger-compatible.

---

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 3:53pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/8 "2025-06-09T15:53:31Z")

</div>

Hi @pturmel  
Thank you for this, and for the links. I have the Integration Toolkit, but I'm struggling to put this all together to actually drop anything into the logger.  
The closest I'm getting is:

```python
try:
	ds = RailManagement.outload.getAnyBatchesAvailable()
except:
	t = Throwable.getCause
	logger.info(str(t))

```

which is just sending \<java function getCause 0x384b03a\>  
(so it's doing something, I suppose).  
Could I impose upon you for pseudocode or syntax assistance, please?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [June 9, 2025, 4:01pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/9 "2025-06-09T16:01:53Z")

</div>

Your line

> [@Cameronin](#):
>
> ```python
> t = Throwable.getCause
> 
> ```

Is referring to the actual `getCause` function definition of the actual class definition `Throwable`.  
\[1\]  
You want to catch a particular exception and then log it.

Pturmel's [later.py](https://www.automation-pros.com/ignition/later.py) actually has some examples on how you would use it.

Also here's a rough start.

```python
from java.lang import Throwable
#snip
try:
    #bla
except Throwable, t:
    logger.error(t)
except Exception, e:
    logger.error(system.reflection.asThrowable(e))

```

* * *

1. Technically it's referring to a code object not the definition but I'm keeping it simple.

---

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 4:08pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/10 "2025-06-09T16:08:33Z")

</div>

Thanks @Felipe_CRM , I shall try again 🙂

---

<div class="post-metadata">

**Author:** ![Cameronin](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Cameronin](https://forum.inductiveautomation.com/u/Cameronin)\
**Post date:** [June 9, 2025, 4:13pm UTC](https://forum.inductiveautomation.com/t/how-to-view-full-error-text-when-truncated/107176/11 "2025-06-09T16:13:49Z")

</div>

Perfect! That's got what I need dropping into the logs 😃  
Thank you!
