你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Remove logger.exception from outside try except statement
logger.exception should only be used inside a try except statement where there is some error/stacktrace that needs outputting as well as the error message. Instead, should use logger.error then raise an error, and/or pass the message to the error being raised (which the calling function should handle and/or log the exception).
这个提交包含在:
@@ -98,16 +98,14 @@ class Plate(RotatableMixin, GeometryUserObject):
|
||||
or (zs == zf and (xs == xf or ys == yf))
|
||||
or (xs != xf and ys != yf and zs != zf)
|
||||
):
|
||||
logger.exception(f"{self.__str__()} the plate is not specified correctly")
|
||||
raise ValueError
|
||||
raise ValueError(f"{self.__str__()} the plate is not specified correctly")
|
||||
|
||||
# Look up requested materials in existing list of material instances
|
||||
materials = [y for x in materialsrequested for y in grid.materials if y.ID == x]
|
||||
|
||||
if len(materials) != len(materialsrequested):
|
||||
notfound = [x for x in materialsrequested if x not in materials]
|
||||
logger.exception(f"{self.__str__()} material(s) {notfound} do not exist")
|
||||
raise ValueError
|
||||
raise ValueError(f"{self.__str__()} material(s) {notfound} do not exist")
|
||||
|
||||
# yz-plane plate
|
||||
if xs == xf:
|
||||
|
在新工单中引用
屏蔽一个用户