Skip to content

Commit

Permalink
upadted erro msg for 429 and readme changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hardik-crest committed Jun 23, 2023
1 parent 2ff0559 commit 92bb747
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
7 changes: 4 additions & 3 deletions office365_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def _process_json_response(self, r, action_result):

# You should process the error returned in the json

msg = "Error : Status Code: {0} Data from server: {1}".format(
msg = "Error: Status Code: {0} Data from server: {1}".format(
r.status_code, error_text)

return RetVal(action_result.set_status(phantom.APP_ERROR, msg), None)
Expand Down Expand Up @@ -3126,9 +3126,10 @@ def _upload_large_attachment(self, action_result, vault_info, user_id, message_i

if retry_time > 300: # throw error if wait time greater than 300 seconds
self.debug_print("Retry is canceled as retry time is greater than 300 seconds")
self._process_response(response, action_result)
return action_result.set_status(
phantom.APP_ERROR, "Error occurred : {}, {} . Please retry after {} \
seconds".format(response.status_code, str(response.text), retry_time)
phantom.APP_ERROR, "Failed to upload file, {} Please retry after \
{} seconds".format(action_result.get_message(), retry_time )
), None
self.debug_print("Retrying after {} seconds".format(retry_time))
time.sleep(retry_time + 1)
Expand Down
11 changes: 2 additions & 9 deletions readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2>Authentication</h2>
<li>Group.Read.All (https://graph.microsoft.com/Group.Read.All) - It is required only if you want to run the <b>list events</b> action for the group's calendar and for the <b>list groups</b> and the <b>list group members</b> action.</li>
<li>Calendar.Read (https://graph.microsoft.com/Calendars.Read) - It is required only if you want to run the <b>list events</b> action for the user's calendar.</li>
<li>Calendars.ReadWrite (https://graph.microsoft.com/Calendars.ReadWrite) - It is required only if you want to run the <b>delete event</b> action from the user's calendar.</li></li>
<li>MailboxSettings.Read (https://graph.microsoft.com/MailboxSettings.Read) - It is required only if you want to run the <b>oof status</b> action.</li>
<li>MailboxSettings.Read (https://graph.microsoft.com/MailboxSettings.Read) - It is required only if you want to run the <b>oof status</b>, <b>list rules</b> and <b>get rule</b> actions.</li>
</ul>
</ul>
After making these changes, click <b>Add permissions</b>, then select <b>Grant admin consent for &lt;your_organization_name_as_on_azure_portal&gt;</b> at the bottom of the screen.
Expand Down Expand Up @@ -117,14 +117,7 @@ <h3>On-Poll</h3>
<li>extract_domains - Extract the domain names present in the emails.</li>
<li>extract_hashes - Extract the hashes present in the emails (MD5).</li>
<li>ingest_eml - Fetch the EML file content for the 'item attachment' and ingest it into the vault. This will only ingest the first level 'item attachment' as an EML file. The nested item attachments will not be ingested into the vault. If the extract_attachments flag is set to false, then the application will also skip the EML file ingestion regardless of this flag value.</li>
<li>extract_eml
<ul>
<li>When polling is on and extract_eml is enabled, it will add the eml files of the root email in the vault.</li>
<li>
If the extract_attachments flag is set to false, then the application will also skip the itemAttachment and eml file ingestion regardless of the ingest_eml and extract_eml flag value.
</li>
</ul>
</li>
<li>extract_eml - When polling is on and extract_eml is enabled, it will add the eml files of the root email in the vault.</li>
</ul>
<p>If extract_attachments is set to true, only fileAttachment will be ingested. If both ingest_eml and extract_attachments are set to true, then both fileAttachment and itemAttachment will be ingested.</p>
<h2>Guidelines to provide folder parameter value</h2>
Expand Down

0 comments on commit 92bb747

Please sign in to comment.