Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / StringTypeEffectiveStatementImpl.java
index 895f14dde10fea858d67803a130aafa202c1b3b6..edbc8dce353d6825ed441dd204eb1f542b2c04db 100644 (file)
@@ -59,8 +59,8 @@ public final class StringTypeEffectiveStatementImpl extends DeclaredEffectiveSta
             typeDefinition = builder.build();
         } catch (InvalidLengthConstraintException e) {
             final LengthConstraint c = e.getOffendingConstraint();
-            throw new SourceException(String.format("Invalid length constraint: <%s, %s>", c.getMin(), c.getMax()),
-                ctx.getStatementSourceReference(), e);
+            throw new SourceException(ctx.getStatementSourceReference(), e, "Invalid length constraint: <%s, %s>",
+                c.getMin(), c.getMax());
         }
     }