Files
jackson3-by-example/exceptions/scripts/review-catches.sh
T

13 lines
721 B
Bash
Executable File

#!/usr/bin/env bash
# Lists the places a rename cannot judge. Every hit needs a human look.
# Usage: scripts/review-catches.sh <project-dir>
set -uo pipefail
cd "$1"
files=$(grep -rlE 'tools\.jackson|com\.fasterxml\.jackson\.(core|databind)|OrderCodec' --include='*.java' src | sort)
echo "-- catch/throws IOException in files that touch Jackson (or its wrappers)"
grep -nE 'catch *\([^)]*(IOException)|throws [^{;]*IOException' $files
echo "-- catch IllegalArgumentException (convertValue no longer wraps)"
grep -nE 'catch *\([^)]*IllegalArgumentException' $files
echo "-- generic catches that now also receive Jackson errors"
grep -nE 'catch *\((final )?(RuntimeException|Exception|Throwable) ' $files || echo "(none)"