Skip to content

Commit

Permalink
Merge pull request #40 from ImMin5/master
Browse files Browse the repository at this point in the history
Add exception for ResourceNotFound
  • Loading branch information
ImMin5 authored Nov 1, 2023
2 parents 034d3d2 + 75af8fe commit adbcbbf
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
import time
import pandas as pd
import numpy as np
from io import StringIO

from io import StringIO
from datetime import datetime

from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
from azure.mgmt.costmanagement import CostManagementClient
from azure.core.exceptions import ResourceNotFoundError
from cloudforet.cost_analysis.conf.cost_conf import *
from spaceone.core.connector import BaseConnector
from spaceone.core.error import *
from cloudforet.cost_analysis.error.cost import *
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
from azure.mgmt.costmanagement import CostManagementClient

__all__ = ['AzureCostMgmtConnector']

Expand Down Expand Up @@ -98,7 +100,9 @@ def begin_create_operation(self, scope, parameters):
blobs = result.get('blobs', []) or []
_LOGGER.debug(f'[begin_create_operation] csv_file_link: {blobs}')
return blobs

except ResourceNotFoundError as e:
_LOGGER.error(f'[begin_create_operation] Cost data is not ready: {e}')
return []
except Exception as e:
_LOGGER.error(f'[begin_create_operation] error message: {e}')
raise ERROR_UNKNOWN(message=f'[ERROR] begin_create_operation failed')
Expand Down

0 comments on commit adbcbbf

Please sign in to comment.