Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / BinaryTypeEffectiveStatementImpl.java
index 3c528f7a90d3513b6345dbcb36f2c08ba50f3d58..62b37a3af580e5547f9cec0df7453b56f89ed715 100644 (file)
@@ -47,8 +47,8 @@ public final class BinaryTypeEffectiveStatementImpl 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());
         }
     }