Skip to content

Commit ba760eb

Browse files
author
martin
committed
added codes to exceptions
1 parent d023ff2 commit ba760eb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Src/Tools/Shells/Bash/PasswordAuthentication.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ protected function passwordConnectFromBash($ctrlObj, $ipObj, $userName, $passwor
160160
return \MTM\SSH\Factories::getShells()->getRouterOsTool()->getDestinationShell($ctrlObj, $userName);
161161

162162
} elseif ($rType == "error") {
163-
throw new \Exception("Connect error: " . $rValue);
163+
throw new \Exception("Connect error: " . $rValue, 87675);
164164
} else {
165-
throw new \Exception("Not Handled: " . $rType);
165+
throw new \Exception("Not Handled: " . $rType, 87676);
166166
}
167167
}
168168
}

Src/Tools/Shells/Bash/PublicKeyAuthentication.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
//© 2019 Martin Peter Madsen
2+
// 2019 Martin Peter Madsen
33
namespace MTM\SSH\Tools\Shells\Bash;
44

55
abstract class PublicKeyAuthentication extends \MTM\SSH\Tools\Shells\Base
@@ -135,9 +135,9 @@ protected function keyConnectFromBash($ctrlObj, $ipObj, $userName, $keyObj, $por
135135
return \MTM\SSH\Factories::getShells()->getRouterOsTool()->getDestinationShell($ctrlObj, $userName);
136136

137137
} elseif ($rType == "error") {
138-
throw new \Exception("Connect error: " . $rValue);
138+
throw new \Exception("Connect error: " . $rValue, 87677);
139139
} else {
140-
throw new \Exception("Not Handled: " . $rType);
140+
throw new \Exception("Not Handled: " . $rType, 87678);
141141
}
142142
}
143143
}

Src/Tools/Shells/RouterOs/PasswordAuthentication.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ protected function passwordConnectFromRouterOs($ctrlObj, $ipObj, $userName, $pas
116116
}
117117

118118
if ($rType == "error") {
119-
throw new \Exception("Connect error: " . $rValue);
119+
throw new \Exception("Connect error: " . $rValue, 88675);
120120
} else {
121-
throw new \Exception("Not Handled: " . $rType);
121+
throw new \Exception("Not Handled: " . $rType, 88676);
122122
}
123123
}
124124
}

0 commit comments

Comments
 (0)