If you commit an indiscretion you are doing something wrong that shows a lack of judgment. Perhaps stealing candy was your first indiscretion. Likely it will not be your last.
You'll often hear the word indiscretion used when referring to politicians or public figures caught in a scandal. Used this way, the word implies poor judgment for both the wrong and the fact that the politician got caught. If you are going to commit an indiscretion, it's best to be a bit discreet, or subtle, about it.