001package edu.pdx.cs410J.di;
002
003/**
004 * Throw when there was an error when transacting with a {@link edu.pdx.cs410J.di.CreditCardService}
005 */
006public class CreditCardTransactionException extends RuntimeException
007{
008    private CreditTransactionCode code;
009
010    public CreditCardTransactionException( CreditTransactionCode code )
011    {
012        super(code.name());
013        this.code = code;
014    }
015
016    /**
017     * Returns the error code of the transaction 
018     * @return
019     */
020    public CreditTransactionCode getCode()
021    {
022        return code;
023    }
024}