How to use the mattermostdriver.exceptions.ContentTooLarge function in mattermostdriver

To help you get started, we’ve selected a few mattermostdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sandialabs / dr_robot / src / robot_api / api / upload.py View on Github external
self.filepath), open(
                                    join_abs(
                                        self.filepath), 'rb'))})['file_infos'][0]['id']]

                self.inst.posts.create_post(options={
                    'channel_id': channel_id,
                    'message': f"Recon Data {datetime.datetime.now()}",
                    'file_ids': file_ids
                })

            elif isdir(self.filepath):
                file_location = abspath(self.filepath)

                self._upload_files(file_location, channel_id)

        except exceptions.ContentTooLarge as er:
            print(f"[!] ContentTooLarge {er}")
            logger.exception()
        except exceptions.ResourceNotFound as er:
            print(f"[!] ResourceNotFound {er}")
            logger.exception()
        except OSError as er:
            print(f"[!] File not found {er}")
            logger.exception()