Skip to content

Commit

Permalink
Merge pull request #387 from sot528/ALIS-4232
Browse files Browse the repository at this point in the history
add Class name to exception logs
  • Loading branch information
keillera authored Sep 9, 2019
2 parents 6bd4fd7 + 223d3a7 commit 382c04d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/common/lambda_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def main(self):

return {
'statusCode': 500,
'body': json.dumps({'message': 'Internal server error'})
'body': json.dumps({'message': 'Internal server error: ' + self.__class__.__name__})
}

def __get_params(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_exec_main_ng_with_clienterror(self):
self.assertEqual(response['statusCode'], 500)
self.assertEqual(
json.loads(response['body']),
{'message': 'Internal server error'}
{'message': 'Internal server error: LoginFacebookAuthorizationUrl'}
)

def test_exec_main_ng_with_fberror(self):
Expand All @@ -49,5 +49,5 @@ def test_exec_main_ng_with_fberror(self):
self.assertEqual(response['statusCode'], 500)
self.assertEqual(
json.loads(response['body']),
{'message': 'Internal server error'}
{'message': 'Internal server error: LoginFacebookAuthorizationUrl'}
)
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_main_ng_with_awsexception_and_existing_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginFacebookIndex'
}
)

Expand Down Expand Up @@ -372,6 +372,6 @@ def test_main_ng_with_awsexception_and_new_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginFacebookIndex'
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ def test_exec_main_ng(self):
self.assertEqual(response['statusCode'], 500)
self.assertEqual(
json.loads(response['body']),
{'message': 'Internal server error'}
{'message': 'Internal server error: LoginTwitterAuthorizationUrl'}
)
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_main_ng_with_awsexception_and_existing_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginTwitterIndex'
}
)

Expand Down Expand Up @@ -309,6 +309,6 @@ def test_main_ng_with_awsexception_and_new_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginTwitterIndex'
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_exec_main_ng_with_clienterror(self):
self.assertEqual(response['statusCode'], 500)
self.assertEqual(
json.loads(response['body']),
{'message': 'Internal server error'}
{'message': 'Internal server error: LoginYahooAuthorizationUrl'}
)

def test_exec_main_ng_with_yahoo(self):
Expand All @@ -48,5 +48,5 @@ def test_exec_main_ng_with_yahoo(self):
self.assertEqual(response['statusCode'], 500)
self.assertEqual(
json.loads(response['body']),
{'message': 'Internal server error'}
{'message': 'Internal server error: LoginYahooAuthorizationUrl'}
)
4 changes: 2 additions & 2 deletions tests/handlers/login/yahoo/index/test_login_yahoo_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_main_ng_with_awsexception_and_existing_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginYahooIndex'
}
)

Expand Down Expand Up @@ -372,6 +372,6 @@ def test_main_ng_with_awsexception_and_new_user(self):
self.assertEqual(
json.loads(response['body']),
{
'message': 'Internal server error'
'message': 'Internal server error: LoginYahooIndex'
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_main_with_internal_server_error_on_create_article_info(self):
article_content_after = self.article_content_table.scan()['Items']

self.assertEqual(response['statusCode'], 500)
self.assertEqual(json.loads(response['body'])['message'], 'Internal server error')
self.assertEqual(json.loads(response['body'])['message'], 'Internal server error: MeArticlesDraftsArticleIdCreate')
self.assertEqual(len(article_info_after) - len(article_info_before), 0)
self.assertEqual(len(article_content_after) - len(article_content_before), 0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_main_with_internal_server_error_on_create_article_info(self):
article_content_after = self.article_content_table.scan()['Items']

self.assertEqual(response['statusCode'], 500)
self.assertEqual(json.loads(response['body'])['message'], 'Internal server error')
self.assertEqual(json.loads(response['body'])['message'], 'Internal server error: MeArticlesDraftsCreate')
self.assertEqual(len(article_info_after) - len(article_info_before), 0)
self.assertEqual(len(article_content_after) - len(article_content_before), 0)

Expand Down

0 comments on commit 382c04d

Please sign in to comment.