Code: Select all
{"error_code":"platform.unknown_field","correlation_id":"xxxxxx","description":"The entity type 'test_suite_link_to_manual' does not have a field/s by name/s 'manual_test'","description_translated":"The entity type 'test_suite_link_to_manual' does not have a field/s by name/s 'manual_test'","properties":{"entity_type":"test_suite_link_to_manual","field_name":"manual_test"},"business_error":true}
Das Gleiche in dem Groovy -Skript der Pipeline gibt java.io.ioxception: Server zurück. HTTP -Antwortcode: 400 für URL: und nichts darüber hinaus. Ich möchte die Nachricht protokollieren, dass ich das bekomme, was aus dem Browser bekomme. Hier ist der Teil des Codes < /p>
Code: Select all
def connection = new URL(url).openConnection()
try {
attempt++
if (!isCookieValid(3)) {
cookie = getCookie(3)
}
connection.setRequestMethod("GET")
connection.setRequestProperty("Cookie", cookie)
connection.connect()
echo connection.inputStream.text
def responseCode = connection.responseCode
if (responseCode == 200) {
echo "Test suite link to manual tests retrieved successfully"
return connection.inputStream.text
} else {
def errorMessage = new StringBuilder()
if (connection.errorStream != null) {
def reader = new BufferedReader(new InputStreamReader(connection.errorStream))
def line
while ((line = reader.readLine()) != null) {
errorMessage.append(line).append("\n")
}
reader.close()
echo "Bus error" + errorMessage.toString()
}
}
} catch (Exception e) {
def errorMessage = new StringBuilder()
if (connection.errorStream != null) {
def reader = new BufferedReader(new InputStreamReader(connection.errorStream))
def line
while ((line = reader.readLine()) != null) {
errorMessage.append(line).append("\n")
}
reader.close()
echo "Bus error catch " + e + e.message + errorMessage.toString()
}
if (attempt == retries) {
echo "Failed to get test suites link to manual tests after ${retries} attempts"
return null
}
echo "Attempt ${attempt} failed: ${e}. Retrying..."
sleep(5) // Wait for 5 seconds before retrying
}
bekomme
Code: Select all
Bus error catch java.io.IOException: Server returned HTTP response code: 400 for URL: https://dummy/api/test_suite_link_to_manual_tests?fields=id,test_suite,manual_test,test_suite&query="test_suite EQ {id IN 1010101}"Server returned HTTP response code: 400 for URL: https://dummy/api/test_suite_link_to_manual_tests?fields=id,test_suite,manual_test,test_suite&query="test_suite EQ {id IN 1010101}"
400 Bad Request
400 Bad Request
nginx/1.21.5