Skip to content

Commit

Permalink
Load: Add check for BufferUnderflowException (#12690)
Browse files Browse the repository at this point in the history
Co-authored-by: xz m <[email protected]>
  • Loading branch information
ppppoooo and xz m authored Jun 11, 2024
1 parent 3846563 commit c2f3640
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.BufferUnderflowException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -177,6 +178,13 @@ public Analysis analyzeFileByFile() {
String.format("TsFile %s is empty or incomplete.", tsFile.getPath()));
} catch (AuthException e) {
return createFailAnalysisForAuthException(e);
} catch (BufferUnderflowException e) {
LOGGER.warn(
"The file {} is not a valid tsfile. Please check the input file.", tsFile.getPath(), e);
throw new SemanticException(
String.format(
"The file %s is not a valid tsfile. Please check the input file.",
tsFile.getPath()));
} catch (Exception e) {
LOGGER.warn("Parse file {} to resource error.", tsFile.getPath(), e);
throw new SemanticException(
Expand Down

0 comments on commit c2f3640

Please sign in to comment.