Skip to content

Commit

Permalink
Merge pull request #2994 from ControlSystemStudio/scan_script_excepti…
Browse files Browse the repository at this point in the history
…on_msg

Scan 'script' command: Add exception message to error
  • Loading branch information
kasemir authored Apr 4, 2024
2 parents c9fef61 + b440591 commit 911f3e2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012-2020 Oak Ridge National Laboratory.
* Copyright (c) 2012-2024 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -211,6 +211,9 @@ public <T> T loadClass(final Class<T> type, final String class_name, final Strin
public static String getExceptionMessage(final PyException ex)
{
final StringBuilder buf = new StringBuilder();
if (ex.getLocalizedMessage() != null)
buf.append(" ").append(ex.getLocalizedMessage());

if (ex.value instanceof PyString)
buf.append(" ").append(ex.value.asString());
else if (ex.getCause() != null)
Expand Down

0 comments on commit 911f3e2

Please sign in to comment.