Merge pull request #1071 from downslope7/grid-connection-exists-coords

Add coords to duplicate connection GridException.
This commit is contained in:
thatsIch 2015-03-22 07:48:23 +01:00
commit f138a68f3e

View file

@ -77,8 +77,12 @@ public class GridConnection implements IGridConnection, IPathItem
throw new GridException( "Connection Forged Between null entities." );
if ( a.hasConnection( b ) || b.hasConnection( a ) )
throw new GridException( "Connection already exists." );
{
final String aCoords = a.getGridBlock().getLocation().toString();
final String bCoords = b.getGridBlock().getLocation().toString();
throw new GridException( String.format( "Connection already exists between node at [%s] and node at [%s].", aCoords, bCoords ) );
}
this.sideA = a;
this.fromAtoB = fromAtoB;
this.sideB = b;