JDevlieghere added inline comments.

================
Comment at: lldb/examples/python/crashlog.py:1012-1015
+    def error(message, sb_error=lldb.SBError()):
+        nonlocal result
+        result.SetError(sb_error, "error: %s" % message)
+        return
----------------
mib wrote:
> JDevlieghere wrote:
> > Can we do this with a try-catch + an exception?
> @JDevlieghere As mentioned on D129611, if we raise an exception we won't be 
> able to surface the error to lldb or even to IDEs. I think it's better to use 
> the `SBCommandReturnObject`
> 
> @kastiglione true! I'll remove the "error: " prefix, but I think it's 
> reasonable to keep this helper function to avoid code duplication.
Couldn't you still raise the error where it happens and then catch it and then 
take it's value and put it into the SBCommandReturnObject? 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129614/new/

https://reviews.llvm.org/D129614

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to