Change the temporary link design while link snapping

Is there any way to change the temporary link design while snapping the connection, so there is validation error which we show, red link design when the snapping is not possible between 2 nodes, but the temporary link is not being changed realtime.
Is there any way to change it realtime. while making the snapping and the connection comes close to any node where the connection is not possible. I want to show red link.

I want to show the blue dotted link to red dotted link when the snapping is failing.
Im doing this from linkValidation, where i check whether the nodes are connected or not. just need to change the color of temporary link.

Override the LinkingBaseTool.copyPortProperties and LinkingBaseTool.setNoTargetPortProperties methods to update the LinkingBaseTool.temporaryLink’s Link.path’s Shape’s properties the way you want for valid linking (the former method) and invalid linking (the latter method).

  $(go.Diagram, "myDiagramDiv",
      "linkingTool.copyPortProperties": function(realnode, realport, tempnode, tempport, toend) {, realnode, realport, tempnode, tempport, toend);
        this.temporaryLink.path.strokeDashArray = null;
        this.temporaryLink.path.stroke = "green";
      "linkingTool.setNoTargetPortProperties": function(tempnode, tempport, toend) {, tempnode, tempport, toend);
        this.temporaryLink.path.strokeDashArray = [3, 3];
        this.temporaryLink.path.stroke = "red";

If your app supports relinking existing links, you probably will want the same overrides on the RelinkingTool.