You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "kbachl (via GitHub)" <gi...@apache.org> on 2024/06/18 10:59:07 UTC

[PR] Expand error messages in Component class [wicket]

kbachl opened a new pull request, #894:
URL: https://github.com/apache/wicket/pull/894

   The error messages in the Component class have been augmented with more detailed information. These include class type, parent markup ID, parent relative path, and the original URL. This is to give a more comprehensive context surrounding the error, aiding debugging and issue resolution.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Expand error messages in Component class [wicket]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #894:
URL: https://github.com/apache/wicket/pull/894#discussion_r1644389731


##########
wicket-core/src/main/java/org/apache/wicket/Component.java:
##########
@@ -2478,7 +2478,8 @@ protected final void internalRenderComponent()
 				if (getFlag(FLAG_OUTPUT_MARKUP_ID))
 				{
 					String message = String.format("Markup id set on a component that renders its body only. " +
-					                               "Markup id: %s, component id: %s.", getMarkupId(), getId());
+					                               "Markup id: %s, component id: %s, class-type: %s, parent markup id: %s, parent relative path: %s, url: %s",
+							getMarkupId(), getId(), getClass(), getParent().getMarkupId(), getParent().getClassRelativePath(), getRequest().getOriginalUrl());

Review Comment:
   1. I don't think we need the url.
   2. Instead of ` getParent().getMarkupId(), getParent().getClassRelativePath()` could we use ` getClassRelativePath()`, i.e. `this.getClassRelativePath()` ? It would be simpler



##########
wicket-core/src/main/java/org/apache/wicket/Component.java:
##########
@@ -2488,7 +2489,8 @@ protected final void internalRenderComponent()
 				if (getFlag(FLAG_PLACEHOLDER))
 				{
 					String message = String.format("Placeholder tag set on a component that renders its body only. " +
-					                               "Component id: %s.", getId());
+					                               "Component id: %s, class-type: %s, parent markup id: %s, parent relative path: %s, url: %s\", ",
+							getId(), getClass(), getParent().getMarkupId(), getParent().getClassRelativePath(), getRequest().getOriginalUrl());

Review Comment:
   Same as above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org