提交 65d78d5b 编写于 作者: I Ing. Pavel Janousek

Unification of issue passing (all in exceptions)

上级 4f60993f
......@@ -103,19 +103,23 @@ public class ViewOptionHandler extends OptionHandler<View> {
String viewName = tok.nextToken();
view = group.getView(viewName);
if (view == null) throw new CmdLineException(owner, String.format(
"No view named %s inside view %s",
viewName, group.getDisplayName()
));
if(!view.hasPermission(View.READ))
return null;
if (view == null)
throw new CmdLineException(owner, String.format(
"No view named %s inside view %s",
viewName, group.getDisplayName()
));
try {
view.checkPermission(View.READ);
} catch (Exception e) {
throw new CmdLineException(owner, e.getMessage());
}
if (view instanceof ViewGroup) {
group = (ViewGroup) view;
} else if (tok.hasMoreTokens()) {
throw new CmdLineException(
owner, view.getViewName() + " view can not contain views"
owner, view.getViewName() + " view can not contain views"
);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册