Changeset 2983


Ignore:
Timestamp:
Feb 4, 2013, 2:10:14 PM (9 years ago)
Author:
Peter
Message:

fixes #751. throw if OutBamFile::write fails

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/bam_iterator.cc

    r2943 r2983  
    11// $Id$
    22//
    3 // Copyright (C) 2012 Peter Johansson
     3// Copyright (C) 2012, 2013 Peter Johansson
    44//
    55// This program is free software; you can redistribute it and/or modify
     
    4747  return EXIT_SKIP;
    4848#endif
    49   test1(suite);
     49  try {
     50    test1(suite);
     51  }
     52  catch (std::runtime_error& e) {
     53    suite.add(false);
     54    suite.err() << "error: what: " << e.what() << "\n";
     55  }
    5056  return suite.return_value();
    5157}
  • trunk/yat/omic/BamFile.cc

    r2943 r2983  
    11// $Id$
    22//
    3 // Copyright (C) 2012 Peter Johansson
     3// Copyright (C) 2012, 2013 Peter Johansson
    44//
    55// This program is free software; you can redistribute it and/or modify
     
    131131  void OutBamFile::write(const BamRead& read)
    132132  {
    133     samwrite(sf_, read.bam_);
     133    if (!samwrite(sf_, read.bam_)) {
     134      // FIXME if wanted perhaps we should throw an OutBamFile::error
     135      // instead that can hold \a read
     136      throw utility::runtime_error("OutBamFile::write failed");
     137    }
    134138  }
    135139
  • trunk/yat/omic/BamFile.h

    r2943 r2983  
    44// $Id$
    55//
    6 // Copyright (C) 2012 Peter Johansson
     6// Copyright (C) 2012, 2013 Peter Johansson
    77//
    88// This program is free software; you can redistribute it and/or modify
     
    199199    /**
    200200       \brief write a read to output file
     201
     202       \throw utility::runtime_error if write failed
    201203     */
    202204    void write(const BamRead& read);
Note: See TracChangeset for help on using the changeset viewer.