Skip to content

No error when file is not readable #67

Open
@Guigoz

Description

@Guigoz

Hello,

First I would like to thank you for your great work on PacketQ! It's a blazzing fast tool!

Lately I've been surprised to see that PacketQ does not return any error when the file is not readable or does not exists.

$ /usr/local/bin/packetq -s "SELECT * FROM dns" /tmp/thisFileDoesNotExist                                           
[
  {
    "table_name": "result-0",
    "query": "SELECT * FROM dns",
    "head": [
      { "name": "id","type": "int" },
      { "name": "s","type": "int" },
      { "name": "us","type": "int" },
      { "name": "ether_type","type": "int" },
      { "name": "src_port","type": "int" },
      { "name": "dst_port","type": "int" },
      { "name": "src_addr","type": "text" },
      { "name": "dst_addr","type": "text" },
      { "name": "protocol","type": "int" },
      { "name": "ip_ttl","type": "int" },
      { "name": "ip_version","type": "int" },
      { "name": "fragments","type": "int" },
      { "name": "qname","type": "text" },
      { "name": "aname","type": "text" },
      { "name": "msg_id","type": "int" },
      { "name": "msg_size","type": "int" },
      { "name": "opcode","type": "int" },
      { "name": "rcode","type": "int" },
      { "name": "extended_rcode","type": "int" },
      { "name": "edns_version","type": "int" },
      { "name": "z","type": "int" },
      { "name": "udp_size","type": "int" },
      { "name": "qd_count","type": "int" },
      { "name": "an_count","type": "int" },
      { "name": "ns_count","type": "int" },
      { "name": "ar_count","type": "int" },
      { "name": "qtype","type": "int" },
      { "name": "qclass","type": "int" },
      { "name": "atype","type": "int" },
      { "name": "aclass","type": "int" },
      { "name": "attl","type": "int" },
      { "name": "aa","type": "bool" },
      { "name": "tc","type": "bool" },
      { "name": "rd","type": "bool" },
      { "name": "cd","type": "bool" },
      { "name": "ra","type": "bool" },
      { "name": "ad","type": "bool" },
      { "name": "do","type": "bool" },
      { "name": "edns0","type": "bool" },
      { "name": "qr","type": "bool" },
      { "name": "edns0_ecs","type": "bool" },
      { "name": "edns0_ecs_family","type": "int" },
      { "name": "edns0_ecs_source","type": "int" },
      { "name": "edns0_ecs_scope","type": "int" },
      { "name": "edns0_ecs_address","type": "text" }
    ],
    "data": [
    ]
  }
]

I think an error message and return code would be more suitable.
What do you think of this?

Guillaume.

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