Skip to content

Commit

Permalink
FEAT ITEM-321-back-modifier-lintitule-de-messages-derreur :
Browse files Browse the repository at this point in the history
     - modification de messages d'erreur
  • Loading branch information
EryneKL committed Oct 23, 2024
1 parent 52d1c00 commit 5c5a6d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected int getIndexZone(IndexRecherche indexCourant, String[] tabLigne, int i
*/
protected void checkRcr(String rcrFichier, String rcr, int ligneCourante) throws FileCheckingException {
if (!rcrFichier.equals(rcr)) {
throw new FileCheckingException(Constant.ERR_FILE_ERRLINE + ligneCourante + Constant.ERR_FILE_WRONGRCR);
throw new FileCheckingException(Constant.ERR_FILE_LINE + ligneCourante + " : " + Constant.ERR_FILE_WRONGRCR);
}
}

Expand All @@ -100,7 +100,7 @@ protected void checkRcr(String rcrFichier, String rcr, int ligneCourante) throws
*/
protected void checkPpn(String ppn, int ligneCourante) throws FileCheckingException {
if (!ppn.matches("^(\\d{8}[0-9X])?$")){
throw new FileCheckingException(Constant.ERR_FILE_ERRLINE + ligneCourante + Constant.ERR_FILE_WRONGPPN);
throw new FileCheckingException(Constant.ERR_FILE_LINE + ligneCourante + " : " + Constant.ERR_FILE_WRONGPPN);
}
}

Expand All @@ -111,7 +111,7 @@ protected void checkPpn(String ppn, int ligneCourante) throws FileCheckingExcept
*/
protected void checkEpn(String epn, int ligneCourante) throws FileCheckingException {
if (!epn.matches("^(\\d{8}[0-9X])?$")) {
throw new FileCheckingException(Constant.ERR_FILE_ERRLINE + ligneCourante + Constant.ERR_FILE_WRONGEPN);
throw new FileCheckingException(Constant.ERR_FILE_LINE + ligneCourante + " : " + Constant.ERR_FILE_WRONGEPN);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void checkBodyLine(String ligne, DemandeSupp demandeSupp) throws FileChe
try {
// contrôle de la longueur de la ligne
if (ligne.split(";").length > 3) {
throw new FileCheckingException(Constant.ERR_FILE_ERRLINE + " \"" + ligne + "\" " + Constant.ERR_FILE_3COL_SUPP_ANY_LINE);
throw new FileCheckingException(Constant.ERR_FILE_LINE + ligne + " : " + Constant.ERR_FILE_3COL_SUPP_ANY_LINE);
}
String[] tabligne = ligne.split(";");
// contrôle du ppn
Expand All @@ -98,7 +98,7 @@ private void checkBodyLine(String ligne, DemandeSupp demandeSupp) throws FileChe
if (tabligne.length > 2)
checkEpn(tabligne[2], ligneCourante);
} catch (IndexOutOfBoundsException e) {
throw new FileCheckingException(Constant.ERR_FILE_ERRLINE + ligneCourante + Constant.ERR_FILE_LINELENGTH);
throw new FileCheckingException(Constant.ERR_FILE_LINE + ligneCourante + " : " + Constant.ERR_FILE_LINELENGTH);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public class Constant implements Serializable {
public static final String ERR_FILE_3COL_SUPP = "La première ligne du fichier doit contenir 3 colonnes (ppn;rcr;epn)";
public static final String ERR_FILE_3COL_SUPP_ANY_LINE = "La ligne doit contenir trois colones";
public static final String ERR_FILE_ERRLINE = "Erreur ligne ";
public static final String ERR_FILE_LINE = "Ligne ";
public static final String ERR_FILE_ONLYONEPPN = "la ligne ne doit contenir qu'un ppn (sur 9 caractères).";
public static final String ERR_FILE_HEAD4TH = "La valeur en-tête de la quatrieme colonne n'est pas valide.";
public static final String ERR_FILE_LINELENGTH = " : Il y a un problème lié à la longueur de la ligne.";
Expand Down

0 comments on commit 5c5a6d8

Please sign in to comment.