Skip to content

bug: Reader's seek operation incorrectly panic when the parameter is not valid #2636

@dqhl76

Description

@dqhl76

For the seek operation of OpenDAL's reader, if seek to a negative or overflowing position, it will cause panic unexpectedly.

How to reproduce?

let r = op.reader("path/to/file")
r.seek(SeekFrom::Current(-1024))
Error occurred: Unexpected (permanent) at Reader::seek => invalid seek to a negative or overflowing position

What we expected?

It will not cause panic and return the error in the seek's result


related discussion: https://discord.com/channels/1081052318650339399/1122785258501308497/1129261665146388490

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions