@@ -1932,6 +1932,8 @@ static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
1932
1932
hts_log_info ("Querying ref %s" , m5_str );
1933
1933
1934
1934
if (!(ref_fn = m5_to_path (m5_str ))){
1935
+ hts_log_warning ("Failed to find reference with MD5 \"%s\"." , m5_str );
1936
+
1935
1937
no_m5 = 1 ;
1936
1938
}
1937
1939
}
@@ -1954,8 +1956,11 @@ static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
1954
1956
return -1 ;
1955
1957
fd -> refs -> fp = NULL ;
1956
1958
}
1957
- if (!(refs = refs_load_fai (fd -> refs , fn , 0 )))
1959
+ if (!(refs = refs_load_fai (fd -> refs , fn , 0 ))){
1960
+ hts_log_warning ("Failed to find reference \"%s\" from the @SQ UR: tag." , fn );
1961
+
1958
1962
return -1 ;
1963
+ }
1959
1964
sanitise_SQ_lines (fd );
1960
1965
1961
1966
fd -> refs = refs ;
@@ -1984,7 +1989,12 @@ static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
1984
1989
/* Read the whole sequence into memory, as we're dealing with a remote file */
1985
1990
kstring_t ref_seq = {0 };
1986
1991
1987
- hFILE * ref_hfile = hopen (ref_fn , "r" );
1992
+ hFILE * ref_hfile ;
1993
+ if (!(ref_hfile = hopen (ref_fn , "r" ))){
1994
+ hts_log_error ("Failed to open reference \"%s\": %s" , ref_fn , strerror (errno ));
1995
+
1996
+ return -1 ;
1997
+ }
1988
1998
1989
1999
do {
1990
2000
ks_resize (& ref_seq , ks_len (& ref_seq ) + READ_LENGTH );
@@ -2022,7 +2032,6 @@ static int cram_populate_ref(cram_fd *fd, int id, ref_entry *r) {
2022
2032
free (ref_fn );
2023
2033
2024
2034
return 0 ;
2025
-
2026
2035
}
2027
2036
2028
2037
static void cram_ref_incr_locked (refs_t * r , int id ) {
0 commit comments