<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: why there is no option for write mode for move/copy files in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704555#M31358</link>
    <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1710958"&gt;@Thang2000&lt;/a&gt; I'll pass this along as a feature request for support for setting the write mode when moving/copying files, but I can't promise if or when that might be implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you can find &lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/updown.py#L187" target="_blank"&gt;an example of catching an API error in the Python SDK here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 14:44:46 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2023-08-07T14:44:46Z</dc:date>
    <item>
      <title>why there is no option for write mode for move/copy files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704163#M31348</link>
      <description>&lt;P&gt;I notice there is an option to use writemode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mode=dropbox.files.WriteMode.overwrite&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when using uploading API ( dbx.files_upload() ), but there is no option for copying/moving file api. Can we add that? I'm using Python SDK:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dbx.files_move_v2()
dbx.files_copy_v2()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;and have been writing many boilerplates to handle file conflicts.&lt;BR /&gt;&lt;BR /&gt;Also, what is the proper way to handle this, right now I'm doing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;try:
    dbx.files_copy_v2(from_path=entry.path_display, to_path=path_to_autopdf_folder)
except WriteConflictError as e:&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;but getting "catching classes that do not inherit from baseexception is not allowed python".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Appreciate the help.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 20:51:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704163#M31348</guid>
      <dc:creator>Thang2000</dc:creator>
      <dc:date>2023-08-04T20:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: why there is no option for write mode for move/copy files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704185#M31349</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1710958"&gt;@Thang2000&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;BR /&gt;Also, what is the proper way to handle this, right now I'm doing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;try:
    dbx.files_copy_v2(from_path=entry.path_display, to_path=path_to_autopdf_folder)
except WriteConflictError as e:&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but getting "catching classes that do not inherit from baseexception is not allowed python".&amp;nbsp;&lt;BR /&gt;...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1710958"&gt;@Thang2000&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In most programing languages not all types can be thrown (and catched, of course), but only a subset (so called throwable types). As you saw already, in Python that subset is form of types inherited from the mentioned class. That's it. Here make a note that you are trying to catch WriteConflictError class' object; a class that is regular, non throwable (i.e. not exception) class. All errors that comes from API use &lt;A title="Errors produced by the Dropbox API" href="https://github.com/dropbox/dropbox-sdk-python/blob/main/dropbox/exceptions.py#L14" target="_blank" rel="noopener"&gt;ApiError class&lt;/A&gt; as a carrier. There you can inspect what's in error field to see what's the actual error (including its type). You may put the carrier class in all similar except statements where the target is Dropbox API and once catch the error actual error type can be found out. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies matter to some extent.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 22:44:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704185#M31349</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-08-04T22:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: why there is no option for write mode for move/copy files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704555#M31358</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1710958"&gt;@Thang2000&lt;/a&gt; I'll pass this along as a feature request for support for setting the write mode when moving/copying files, but I can't promise if or when that might be implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you can find &lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/updown.py#L187" target="_blank"&gt;an example of catching an API error in the Python SDK here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 14:44:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-there-is-no-option-for-write-mode-for-move-copy-files/m-p/704555#M31358</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-08-07T14:44:46Z</dc:date>
    </item>
  </channel>
</rss>

