Try the following awksolution:
awk '
/^GET/ { delete lines; c=0; inBlock=1 }
/^error:/ { for(i=1; i<=c; ++i) print lines[i]; print; exit }
inBlock { lines[++c] = $0 }
' file
This assumes that only 1 block should be printed and that a line should also be printed error:. (Update: see below for a solution that prints only the last block).
/^GET/ { delete lines; c=0; inBlock=1 } lines , GET ./^error:/ { for(i=1; i<=c; ++i) print lines[i]; print; exit } error: , , , .inBlock { lines[++c] = $0 } , GET .
, OP:
() , error:, :
awk '
/^GET/ { delete lines; c=0; inBlock=1 }
inBlock { lines[++c] = $0 }
/^error:/ { inBlock=0; }
END { for(i=1; i<=c; ++i) print lines[i] }
' file
, , "", , END Awk script.